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 | |
arovir01 | 7c22c70 | 2018-10-09 11:16:46 +0100 | [diff] [blame] | 69 | bool IsFloorSupported(const TensorInfo& input, |
| 70 | const TensorInfo& output, |
| 71 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 72 | |
| 73 | bool IsFullyConnectedSupported(const TensorInfo& input, |
| 74 | const TensorInfo& output, |
| 75 | const TensorInfo& weights, |
| 76 | const TensorInfo& biases, |
| 77 | const FullyConnectedDescriptor& descriptor, |
| 78 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 79 | |
| 80 | bool IsInputSupported(const TensorInfo& input, |
| 81 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 82 | |
| 83 | bool IsL2NormalizationSupported(const TensorInfo& input, |
| 84 | const TensorInfo& output, |
| 85 | const L2NormalizationDescriptor& descriptor, |
| 86 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 87 | |
| 88 | bool IsLstmSupported(const TensorInfo& input, |
| 89 | const TensorInfo& outputStateIn, |
| 90 | const TensorInfo& cellStateIn, |
| 91 | const TensorInfo& scratchBuffer, |
| 92 | const TensorInfo& outputStateOut, |
| 93 | const TensorInfo& cellStateOut, |
| 94 | const TensorInfo& output, |
| 95 | const LstmDescriptor& descriptor, |
| 96 | const TensorInfo& inputToForgetWeights, |
| 97 | const TensorInfo& inputToCellWeights, |
| 98 | const TensorInfo& inputToOutputWeights, |
| 99 | const TensorInfo& recurrentToForgetWeights, |
| 100 | const TensorInfo& recurrentToCellWeights, |
| 101 | const TensorInfo& recurrentToOutputWeights, |
| 102 | const TensorInfo& forgetGateBias, |
| 103 | const TensorInfo& cellBias, |
| 104 | const TensorInfo& outputGateBias, |
| 105 | const TensorInfo* inputToInputWeights, |
| 106 | const TensorInfo* recurrentToInputWeights, |
| 107 | const TensorInfo* cellToInputWeights, |
| 108 | const TensorInfo* inputGateBias, |
| 109 | const TensorInfo* projectionWeights, |
| 110 | const TensorInfo* projectionBias, |
| 111 | const TensorInfo* cellToForgetWeights, |
| 112 | const TensorInfo* cellToOutputWeights, |
| 113 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 114 | |
keidav01 | a959ee5 | 2018-12-19 10:04:58 +0000 | [diff] [blame] | 115 | bool IsMaximumSupported(const TensorInfo& input0, |
| 116 | const TensorInfo& input1, |
| 117 | const TensorInfo& output, |
| 118 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 119 | |
arovir01 | 7c22c70 | 2018-10-09 11:16:46 +0100 | [diff] [blame] | 120 | bool IsMeanSupported(const TensorInfo& input, |
| 121 | const TensorInfo& output, |
| 122 | const MeanDescriptor& descriptor, |
| 123 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 124 | |
| 125 | bool IsMergerSupported(const std::vector<const TensorInfo*> inputs, |
Nikhil Raj | 8599a41 | 2018-11-19 14:51:07 +0000 | [diff] [blame] | 126 | const TensorInfo& output, |
arovir01 | 7c22c70 | 2018-10-09 11:16:46 +0100 | [diff] [blame] | 127 | const OriginsDescriptor& descriptor, |
| 128 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 129 | |
| 130 | bool IsMultiplicationSupported(const TensorInfo& input0, |
| 131 | const TensorInfo& input1, |
| 132 | const TensorInfo& output, |
| 133 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 134 | |
| 135 | bool IsNormalizationSupported(const TensorInfo& input, |
| 136 | const TensorInfo& output, |
| 137 | const NormalizationDescriptor& descriptor, |
| 138 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 139 | |
| 140 | bool IsOutputSupported(const TensorInfo& output, |
| 141 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 142 | |
| 143 | bool IsPadSupported(const TensorInfo& input, |
| 144 | const TensorInfo& output, |
| 145 | const PadDescriptor& descriptor, |
| 146 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 147 | |
| 148 | bool IsPermuteSupported(const TensorInfo& input, |
| 149 | const TensorInfo& output, |
| 150 | const PermuteDescriptor& descriptor, |
| 151 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 152 | |
| 153 | bool IsPooling2dSupported(const TensorInfo& input, |
| 154 | const TensorInfo& output, |
| 155 | const Pooling2dDescriptor& descriptor, |
| 156 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 157 | |
| 158 | bool IsReshapeSupported(const TensorInfo& input, |
| 159 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 160 | |
| 161 | bool IsResizeBilinearSupported(const TensorInfo& input, |
| 162 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 163 | |
| 164 | bool IsSoftmaxSupported(const TensorInfo& input, |
| 165 | const TensorInfo& output, |
| 166 | const SoftmaxDescriptor& descriptor, |
| 167 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 168 | |
Sadik Armagan | f446432 | 2018-12-20 16:19:12 +0000 | [diff] [blame] | 169 | bool IsSpaceToBatchNdSupported(const TensorInfo& input, |
| 170 | const TensorInfo& output, |
| 171 | const SpaceToBatchNdDescriptor& descriptor, |
| 172 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 173 | |
arovir01 | 7c22c70 | 2018-10-09 11:16:46 +0100 | [diff] [blame] | 174 | bool IsSplitterSupported(const TensorInfo& input, |
| 175 | const ViewsDescriptor& descriptor, |
| 176 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 177 | |
keidav01 | d74dc91 | 2018-12-10 18:16:07 +0000 | [diff] [blame] | 178 | bool IsStridedSliceSupported(const TensorInfo& input, |
| 179 | const TensorInfo& output, |
| 180 | const StridedSliceDescriptor& descriptor, |
| 181 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 182 | |
arovir01 | 7c22c70 | 2018-10-09 11:16:46 +0100 | [diff] [blame] | 183 | bool IsSubtractionSupported(const TensorInfo& input0, |
| 184 | const TensorInfo& input1, |
| 185 | const TensorInfo& output, |
| 186 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 187 | }; |
| 188 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 189 | } // namespace armnn |