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 | { |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 11 | |
| 12 | class ClLayerSupport : public ILayerSupport |
| 13 | { |
arovir01 | 7c22c70 | 2018-10-09 11:16:46 +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 | |
Mike Kelly | 831faed | 2018-11-28 11:52:08 +0000 | [diff] [blame] | 34 | bool IsBatchToSpaceNdSupported(const TensorInfo& input, |
| 35 | const TensorInfo& output, |
| 36 | const BatchToSpaceNdDescriptor& descriptor, |
| 37 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 38 | |
arovir01 | 7c22c70 | 2018-10-09 11:16:46 +0100 | [diff] [blame] | 39 | bool IsConstantSupported(const TensorInfo& output, |
| 40 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 41 | |
| 42 | bool IsConvertFp16ToFp32Supported(const TensorInfo& input, |
| 43 | const TensorInfo& output, |
| 44 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 45 | |
| 46 | bool IsConvertFp32ToFp16Supported(const TensorInfo& input, |
| 47 | const TensorInfo& output, |
| 48 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 49 | |
| 50 | bool IsConvolution2dSupported(const TensorInfo& input, |
| 51 | const TensorInfo& output, |
| 52 | const Convolution2dDescriptor& descriptor, |
| 53 | const TensorInfo& weights, |
| 54 | const Optional<TensorInfo>& biases, |
| 55 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 56 | |
| 57 | bool IsDepthwiseConvolutionSupported(const TensorInfo& input, |
| 58 | const TensorInfo& output, |
| 59 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 60 | const TensorInfo& weights, |
| 61 | const Optional<TensorInfo>& biases, |
| 62 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 63 | |
| 64 | bool IsDivisionSupported(const TensorInfo& input0, |
| 65 | const TensorInfo& input1, |
| 66 | const TensorInfo& output, |
| 67 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 68 | |
FrancisMurtagh | 30cdfca | 2018-12-18 12:57:35 +0000 | [diff] [blame] | 69 | bool IsEqualSupported(const TensorInfo& input0, |
| 70 | const TensorInfo& input1, |
| 71 | const TensorInfo& output, |
| 72 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 73 | |
arovir01 | 7c22c70 | 2018-10-09 11:16:46 +0100 | [diff] [blame] | 74 | bool IsFakeQuantizationSupported(const TensorInfo& input, |
| 75 | const FakeQuantizationDescriptor& descriptor, |
| 76 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 77 | |
| 78 | bool IsFloorSupported(const TensorInfo& input, |
| 79 | const TensorInfo& output, |
| 80 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 81 | |
| 82 | bool IsFullyConnectedSupported(const TensorInfo& input, |
| 83 | const TensorInfo& output, |
| 84 | const TensorInfo& weights, |
| 85 | const TensorInfo& biases, |
| 86 | const FullyConnectedDescriptor& descriptor, |
| 87 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 88 | |
FrancisMurtagh | 878f023 | 2018-12-19 10:56:15 +0000 | [diff] [blame] | 89 | bool IsGreaterSupported(const TensorInfo& input0, |
| 90 | const TensorInfo& input1, |
| 91 | const TensorInfo& ouput, |
| 92 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 93 | |
arovir01 | 7c22c70 | 2018-10-09 11:16:46 +0100 | [diff] [blame] | 94 | bool IsInputSupported(const TensorInfo& input, |
| 95 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 96 | |
| 97 | bool IsL2NormalizationSupported(const TensorInfo& input, |
| 98 | const TensorInfo& output, |
| 99 | const L2NormalizationDescriptor& descriptor, |
| 100 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 101 | |
| 102 | bool IsLstmSupported(const TensorInfo& input, |
| 103 | const TensorInfo& outputStateIn, |
| 104 | const TensorInfo& cellStateIn, |
| 105 | const TensorInfo& scratchBuffer, |
| 106 | const TensorInfo& outputStateOut, |
| 107 | const TensorInfo& cellStateOut, |
| 108 | const TensorInfo& output, |
| 109 | const LstmDescriptor& descriptor, |
| 110 | const TensorInfo& inputToForgetWeights, |
| 111 | const TensorInfo& inputToCellWeights, |
| 112 | const TensorInfo& inputToOutputWeights, |
| 113 | const TensorInfo& recurrentToForgetWeights, |
| 114 | const TensorInfo& recurrentToCellWeights, |
| 115 | const TensorInfo& recurrentToOutputWeights, |
| 116 | const TensorInfo& forgetGateBias, |
| 117 | const TensorInfo& cellBias, |
| 118 | const TensorInfo& outputGateBias, |
| 119 | const TensorInfo* inputToInputWeights, |
| 120 | const TensorInfo* recurrentToInputWeights, |
| 121 | const TensorInfo* cellToInputWeights, |
| 122 | const TensorInfo* inputGateBias, |
| 123 | const TensorInfo* projectionWeights, |
| 124 | const TensorInfo* projectionBias, |
| 125 | const TensorInfo* cellToForgetWeights, |
| 126 | const TensorInfo* cellToOutputWeights, |
| 127 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 128 | |
keidav01 | a959ee5 | 2018-12-19 10:04:58 +0000 | [diff] [blame^] | 129 | bool IsMaximumSupported(const TensorInfo& input0, |
| 130 | const TensorInfo& input1, |
| 131 | const TensorInfo& output, |
| 132 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 133 | |
arovir01 | 7c22c70 | 2018-10-09 11:16:46 +0100 | [diff] [blame] | 134 | bool IsMeanSupported(const TensorInfo& input, |
| 135 | const TensorInfo& output, |
| 136 | const MeanDescriptor& descriptor, |
| 137 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 138 | |
| 139 | bool IsMergerSupported(const std::vector<const TensorInfo*> inputs, |
Nikhil Raj | 8599a41 | 2018-11-19 14:51:07 +0000 | [diff] [blame] | 140 | const TensorInfo& output, |
arovir01 | 7c22c70 | 2018-10-09 11:16:46 +0100 | [diff] [blame] | 141 | const OriginsDescriptor& descriptor, |
| 142 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 143 | |
| 144 | bool IsMultiplicationSupported(const TensorInfo& input0, |
| 145 | const TensorInfo& input1, |
| 146 | const TensorInfo& output, |
| 147 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 148 | |
| 149 | bool IsNormalizationSupported(const TensorInfo& input, |
| 150 | const TensorInfo& output, |
| 151 | const NormalizationDescriptor& descriptor, |
| 152 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 153 | |
| 154 | bool IsOutputSupported(const TensorInfo& output, |
| 155 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 156 | |
| 157 | bool IsPadSupported(const TensorInfo& input, |
| 158 | const TensorInfo& output, |
| 159 | const PadDescriptor& descriptor, |
| 160 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 161 | |
| 162 | bool IsPermuteSupported(const TensorInfo& input, |
| 163 | const TensorInfo& output, |
| 164 | const PermuteDescriptor& descriptor, |
| 165 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 166 | |
| 167 | bool IsPooling2dSupported(const TensorInfo& input, |
| 168 | const TensorInfo& output, |
| 169 | const Pooling2dDescriptor& descriptor, |
| 170 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 171 | |
| 172 | bool IsReshapeSupported(const TensorInfo& input, |
| 173 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 174 | |
| 175 | bool IsResizeBilinearSupported(const TensorInfo& input, |
| 176 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 177 | |
| 178 | bool IsSoftmaxSupported(const TensorInfo& input, |
| 179 | const TensorInfo& output, |
| 180 | const SoftmaxDescriptor& descriptor, |
| 181 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 182 | |
| 183 | bool IsSplitterSupported(const TensorInfo& input, |
| 184 | const ViewsDescriptor& descriptor, |
| 185 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 186 | |
keidav01 | d74dc91 | 2018-12-10 18:16:07 +0000 | [diff] [blame] | 187 | bool IsStridedSliceSupported(const TensorInfo& input, |
| 188 | const TensorInfo& output, |
| 189 | const StridedSliceDescriptor& descriptor, |
| 190 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 191 | |
arovir01 | 7c22c70 | 2018-10-09 11:16:46 +0100 | [diff] [blame] | 192 | bool IsSubtractionSupported(const TensorInfo& input0, |
| 193 | const TensorInfo& input1, |
| 194 | const TensorInfo& output, |
| 195 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 196 | }; |
| 197 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 198 | } // namespace armnn |