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