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 | |
David Beck | 3cc9a62 | 2018-10-12 10:38:31 +0100 | [diff] [blame] | 7 | #include <armnn/ILayerSupport.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 8 | |
| 9 | namespace armnn |
| 10 | { |
| 11 | |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 12 | class NeonLayerSupport : public ILayerSupport |
| 13 | { |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 14 | public: |
| 15 | bool IsActivationSupported(const TensorInfo& input, |
| 16 | const TensorInfo& output, |
| 17 | const ActivationDescriptor& descriptor, |
| 18 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 19 | |
| 20 | bool IsAdditionSupported(const TensorInfo& input0, |
| 21 | const TensorInfo& input1, |
| 22 | const TensorInfo& output, |
| 23 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 24 | |
| 25 | bool IsBatchNormalizationSupported(const TensorInfo& input, |
| 26 | const TensorInfo& output, |
| 27 | const TensorInfo& mean, |
| 28 | const TensorInfo& var, |
| 29 | const TensorInfo& beta, |
| 30 | const TensorInfo& gamma, |
| 31 | const BatchNormalizationDescriptor& descriptor, |
| 32 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 33 | |
| 34 | bool IsConstantSupported(const TensorInfo& output, |
| 35 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 36 | |
| 37 | bool IsConvertFp16ToFp32Supported(const TensorInfo& input, |
| 38 | const TensorInfo& output, |
| 39 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 40 | |
| 41 | bool IsConvertFp32ToFp16Supported(const TensorInfo& input, |
| 42 | const TensorInfo& output, |
| 43 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 44 | |
| 45 | bool IsConvolution2dSupported(const TensorInfo& input, |
| 46 | const TensorInfo& output, |
| 47 | const Convolution2dDescriptor& descriptor, |
| 48 | const TensorInfo& weights, |
| 49 | const Optional<TensorInfo>& biases, |
| 50 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 51 | |
| 52 | bool IsDepthwiseConvolutionSupported(const TensorInfo& input, |
| 53 | const TensorInfo& output, |
| 54 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 55 | const TensorInfo& weights, |
| 56 | const Optional<TensorInfo>& biases, |
| 57 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 58 | |
| 59 | bool IsDivisionSupported(const TensorInfo& input0, |
| 60 | const TensorInfo& input1, |
| 61 | const TensorInfo& output, |
| 62 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 63 | |
| 64 | bool IsFakeQuantizationSupported(const TensorInfo& input, |
| 65 | const FakeQuantizationDescriptor& descriptor, |
| 66 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 67 | |
| 68 | bool IsFloorSupported(const TensorInfo& input, |
| 69 | const TensorInfo& output, |
| 70 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 71 | |
| 72 | bool IsFullyConnectedSupported(const TensorInfo& input, |
| 73 | const TensorInfo& output, |
| 74 | const TensorInfo& weights, |
| 75 | const TensorInfo& biases, |
| 76 | const FullyConnectedDescriptor& descriptor, |
| 77 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 78 | |
| 79 | bool IsInputSupported(const TensorInfo& input, |
| 80 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 81 | |
| 82 | bool IsL2NormalizationSupported(const TensorInfo& input, |
| 83 | const TensorInfo& output, |
| 84 | const L2NormalizationDescriptor& descriptor, |
| 85 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 86 | |
| 87 | bool IsLstmSupported(const TensorInfo& input, |
| 88 | const TensorInfo& outputStateIn, |
| 89 | const TensorInfo& cellStateIn, |
| 90 | const TensorInfo& scratchBuffer, |
| 91 | const TensorInfo& outputStateOut, |
| 92 | const TensorInfo& cellStateOut, |
| 93 | const TensorInfo& output, |
| 94 | const LstmDescriptor& descriptor, |
| 95 | const TensorInfo& inputToForgetWeights, |
| 96 | const TensorInfo& inputToCellWeights, |
| 97 | const TensorInfo& inputToOutputWeights, |
| 98 | const TensorInfo& recurrentToForgetWeights, |
| 99 | const TensorInfo& recurrentToCellWeights, |
| 100 | const TensorInfo& recurrentToOutputWeights, |
| 101 | const TensorInfo& forgetGateBias, |
| 102 | const TensorInfo& cellBias, |
| 103 | const TensorInfo& outputGateBias, |
| 104 | const TensorInfo* inputToInputWeights, |
| 105 | const TensorInfo* recurrentToInputWeights, |
| 106 | const TensorInfo* cellToInputWeights, |
| 107 | const TensorInfo* inputGateBias, |
| 108 | const TensorInfo* projectionWeights, |
| 109 | const TensorInfo* projectionBias, |
| 110 | const TensorInfo* cellToForgetWeights, |
| 111 | const TensorInfo* cellToOutputWeights, |
| 112 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 113 | |
| 114 | bool IsMeanSupported(const TensorInfo& input, |
| 115 | const TensorInfo& output, |
| 116 | const MeanDescriptor& descriptor, |
| 117 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 118 | |
| 119 | bool IsMergerSupported(const std::vector<const TensorInfo*> inputs, |
Nikhil Raj | 8599a41 | 2018-11-19 14:51:07 +0000 | [diff] [blame] | 120 | const TensorInfo& output, |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 121 | const OriginsDescriptor& descriptor, |
| 122 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 123 | |
| 124 | bool IsMultiplicationSupported(const TensorInfo& input0, |
| 125 | const TensorInfo& input1, |
| 126 | const TensorInfo& output, |
| 127 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 128 | |
| 129 | bool IsNormalizationSupported(const TensorInfo& input, |
| 130 | const TensorInfo& output, |
| 131 | const NormalizationDescriptor& descriptor, |
| 132 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 133 | |
| 134 | bool IsOutputSupported(const TensorInfo& output, |
| 135 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 136 | |
| 137 | bool IsPadSupported(const TensorInfo& input, |
| 138 | const TensorInfo& output, |
| 139 | const PadDescriptor& descriptor, |
| 140 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 141 | |
| 142 | bool IsPermuteSupported(const TensorInfo& input, |
| 143 | const TensorInfo& output, |
| 144 | const PermuteDescriptor& descriptor, |
| 145 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 146 | |
| 147 | bool IsPooling2dSupported(const TensorInfo& input, |
| 148 | const TensorInfo& output, |
| 149 | const Pooling2dDescriptor& descriptor, |
| 150 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 151 | |
| 152 | bool IsReshapeSupported(const TensorInfo& input, |
| 153 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 154 | |
| 155 | bool IsResizeBilinearSupported(const TensorInfo& input, |
| 156 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 157 | |
| 158 | bool IsSoftmaxSupported(const TensorInfo& input, |
| 159 | const TensorInfo& output, |
| 160 | const SoftmaxDescriptor& descriptor, |
| 161 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 162 | |
| 163 | bool IsSplitterSupported(const TensorInfo& input, |
| 164 | const ViewsDescriptor& descriptor, |
| 165 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 166 | |
| 167 | bool IsSubtractionSupported(const TensorInfo& input0, |
| 168 | const TensorInfo& input1, |
| 169 | const TensorInfo& output, |
| 170 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 171 | }; // class NeonLayerSupport |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 172 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 173 | } // namespace armnn |