telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 4 | // |
| 5 | #pragma once |
| 6 | |
| 7 | #include <armnn/DescriptorsFwd.hpp> |
| 8 | #include <armnn/Types.hpp> |
| 9 | #include <armnn/Tensor.hpp> |
| 10 | |
| 11 | namespace armnn |
| 12 | { |
| 13 | |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 14 | class NeonLayerSupport : public ILayerSupport |
| 15 | { |
| 16 | // TODO implement |
| 17 | }; |
| 18 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 19 | bool IsNeonDirectConvolutionPreferred(const TensorInfo& weightInfo, const Convolution2dDescriptor& desc); |
| 20 | |
| 21 | bool IsNeonNormalizationDescParamsSupported(std::string* reasonIfUnsupported, |
| 22 | const NormalizationDescriptor& parameters); |
| 23 | |
| 24 | bool IsActivationSupportedNeon(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 25 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 26 | const ActivationDescriptor& descriptor, |
| 27 | std::string* reasonIfUnsupported); |
| 28 | |
| 29 | bool IsNeonDepthwiseConvolution2dDescParamsSupported(std::string* reasonIfUnsupported, |
| 30 | const DepthwiseConvolution2dDescriptor& parameters, |
| 31 | const TensorInfo& weights); |
| 32 | |
| 33 | bool IsAdditionSupportedNeon(const TensorInfo& input0, |
| 34 | const TensorInfo& input1, |
| 35 | const TensorInfo& output, |
| 36 | std::string* reasonIfUnsupported); |
| 37 | |
| 38 | bool IsBatchNormalizationSupportedNeon(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 39 | const TensorInfo& output, |
| 40 | const TensorInfo& mean, |
| 41 | const TensorInfo& var, |
| 42 | const TensorInfo& beta, |
| 43 | const TensorInfo& gamma, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 44 | const BatchNormalizationDescriptor& descriptor, |
| 45 | std::string* reasonIfUnsupported = nullptr); |
| 46 | |
| 47 | bool IsConstantSupportedNeon(const TensorInfo& output, |
| 48 | std::string* reasonIfUnsupported = nullptr); |
| 49 | |
| 50 | bool IsConvolution2dSupportedNeon(const TensorInfo& input, |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 51 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 52 | const Convolution2dDescriptor& descriptor, |
| 53 | const TensorInfo& weights, |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame^] | 54 | const Optional<TensorInfo>& biases, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 55 | std::string* reasonIfUnsupported = nullptr); |
| 56 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 57 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 58 | bool IsDepthwiseConvolutionSupportedNeon(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 59 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 60 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 61 | const TensorInfo& weights, |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame^] | 62 | const Optional<TensorInfo>& biases, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 63 | std::string* reasonIfUnsupported = nullptr); |
| 64 | |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 65 | bool IsDivisionSupportedNeon(const TensorInfo& input0, |
| 66 | const TensorInfo& input1, |
| 67 | const TensorInfo& output, |
| 68 | std::string* reasonIfUnsupported = nullptr); |
| 69 | |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 70 | bool IsSubtractionSupportedNeon(const TensorInfo& input0, |
| 71 | const TensorInfo& input1, |
| 72 | const TensorInfo& output, |
| 73 | std::string* reasonIfUnsupported = nullptr); |
| 74 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 75 | bool IsFullyConnectedSupportedNeon(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 76 | const TensorInfo& output, |
| 77 | const TensorInfo& weights, |
| 78 | const TensorInfo& biases, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 79 | const FullyConnectedDescriptor& descriptor, |
| 80 | std::string* reasonIfUnsupported = nullptr); |
| 81 | |
| 82 | bool IsInputSupportedNeon(const TensorInfo& input, |
| 83 | std::string* reasonIfUnsupported = nullptr); |
| 84 | |
| 85 | bool IsL2NormalizationSupportedNeon(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 86 | const TensorInfo& output, |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame] | 87 | const L2NormalizationDescriptor& descriptor, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 88 | std::string* reasonIfUnsupported = nullptr); |
| 89 | |
| 90 | bool IsMergerSupportedNeon(const std::vector<const TensorInfo*> inputs, |
| 91 | const OriginsDescriptor& descriptor, |
| 92 | std::string* reasonIfUnsupported = nullptr); |
| 93 | |
| 94 | bool IsMultiplicationSupportedNeon(const TensorInfo& input0, |
| 95 | const TensorInfo& input1, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 96 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 97 | std::string* reasonIfUnsupported = nullptr); |
| 98 | |
| 99 | bool IsNormalizationSupportedNeon(const TensorInfo& input, |
| 100 | const TensorInfo& output, |
| 101 | const NormalizationDescriptor& descriptor, |
| 102 | std::string* reasonIfUnsupported = nullptr); |
| 103 | |
| 104 | bool IsOutputSupportedNeon(const TensorInfo& output, |
| 105 | std::string* reasonIfUnsupported = nullptr); |
| 106 | |
| 107 | bool IsPermuteSupportedNeon(const TensorInfo& input, |
| 108 | const TensorInfo& output, |
| 109 | const PermuteDescriptor& descriptor, |
| 110 | std::string* reasonIfUnsupported = nullptr); |
| 111 | |
| 112 | bool IsPooling2dSupportedNeon(const TensorInfo& input, |
| 113 | const TensorInfo& output, |
| 114 | const Pooling2dDescriptor& descriptor, |
| 115 | std::string* reasonIfUnsupported = nullptr); |
| 116 | |
| 117 | bool IsResizeBilinearSupportedNeon(const TensorInfo& input, |
| 118 | std::string* reasonIfUnsupported = nullptr); |
| 119 | |
| 120 | bool IsSoftmaxSupportedNeon(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 121 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 122 | const SoftmaxDescriptor& descriptor, |
| 123 | std::string* reasonIfUnsupported = nullptr); |
| 124 | |
| 125 | bool IsSplitterSupportedNeon(const TensorInfo& input, |
| 126 | const ViewsDescriptor& descriptor, |
| 127 | std::string* reasonIfUnsupported = nullptr); |
| 128 | |
| 129 | bool IsFakeQuantizationSupportedNeon(const TensorInfo& input, |
| 130 | const FakeQuantizationDescriptor& descriptor, |
| 131 | std::string* reasonIfUnsupported = nullptr); |
| 132 | |
| 133 | bool IsReshapeSupportedNeon(const TensorInfo& input, |
| 134 | std::string* reasonIfUnsupported = nullptr); |
| 135 | |
| 136 | bool IsFloorSupportedNeon(const TensorInfo& input, |
| 137 | const TensorInfo& output, |
| 138 | std::string* reasonIfUnsupported = nullptr); |
| 139 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 140 | bool IsLstmSupportedNeon(const TensorInfo& input, const TensorInfo& outputStateIn, |
| 141 | const TensorInfo& cellStateIn, const TensorInfo& scratchBuffer, |
| 142 | const TensorInfo& outputStateOut, const TensorInfo& cellStateOut, |
| 143 | const TensorInfo& output, const LstmDescriptor& descriptor, |
| 144 | const TensorInfo& inputToForgetWeights, const TensorInfo& inputToCellWeights, |
| 145 | const TensorInfo& inputToOutputWeights, const TensorInfo& recurrentToForgetWeights, |
| 146 | const TensorInfo& recurrentToCellWeights, const TensorInfo& recurrentToOutputWeights, |
| 147 | const TensorInfo& forgetGateBias, const TensorInfo& cellBias, |
| 148 | const TensorInfo& outputGateBias, const TensorInfo* inputToInputWeights, |
| 149 | const TensorInfo* recurrentToInputWeights, const TensorInfo* cellToInputWeights, |
| 150 | const TensorInfo* inputGateBias, const TensorInfo* projectionWeights, |
| 151 | const TensorInfo* projectionBias, const TensorInfo* cellToForgetWeights, |
| 152 | const TensorInfo* cellToOutputWeights, std::string* reasonIfUnsupported = nullptr); |
| 153 | |
| 154 | bool IsConvertFp16ToFp32SupportedNeon(const TensorInfo& input, |
| 155 | const TensorInfo& output, |
| 156 | std::string* reasonIfUnsupported = nullptr); |
| 157 | |
| 158 | bool IsConvertFp32ToFp16SupportedNeon(const TensorInfo& input, |
| 159 | const TensorInfo& output, |
| 160 | std::string* reasonIfUnsupported = nullptr); |
| 161 | |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 162 | bool IsMeanSupportedNeon(const TensorInfo& input, |
| 163 | const TensorInfo& output, |
| 164 | const MeanDescriptor& descriptor, |
| 165 | std::string* reasonIfUnsupported = nullptr); |
| 166 | |
Nina Drozd | 661dfa7 | 2018-10-02 11:14:17 +0100 | [diff] [blame] | 167 | bool IsPadSupportedNeon(const TensorInfo& input, |
| 168 | const TensorInfo& output, |
| 169 | const PadDescriptor& descriptor, |
| 170 | std::string* reasonIfUnsupported = nullptr); |
| 171 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 172 | } |