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> |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 8 | #include <armnn/Optional.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 9 | #include <armnn/Types.hpp> |
| 10 | #include <armnn/Tensor.hpp> |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 11 | #include <armnn/ArmNN.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 12 | |
| 13 | namespace armnn |
| 14 | { |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 15 | |
| 16 | class ClLayerSupport : public ILayerSupport |
| 17 | { |
| 18 | // TODO implement |
| 19 | }; |
| 20 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 21 | bool IsClDirectConvolution2dSupported(const TensorInfo& weightInfo, const Convolution2dDescriptor& desc); |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 22 | bool IsClDepthwiseConvolution2dDescParamsSupported(Optional<std::string&> reasonIfUnsupported, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 23 | const DepthwiseConvolution2dDescriptor& parameters, |
| 24 | const TensorInfo& weights); |
| 25 | |
| 26 | bool IsActivationSupportedCl(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 27 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 28 | const ActivationDescriptor& descriptor, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 29 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 30 | |
| 31 | bool IsAdditionSupportedCl(const TensorInfo& input0, |
| 32 | const TensorInfo& input1, |
| 33 | const TensorInfo& output, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 34 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 35 | |
| 36 | bool IsBatchNormalizationSupportedCl(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 37 | const TensorInfo& output, |
| 38 | const TensorInfo& mean, |
| 39 | const TensorInfo& var, |
| 40 | const TensorInfo& beta, |
| 41 | const TensorInfo& gamma, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 42 | const BatchNormalizationDescriptor& descriptor, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 43 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 44 | |
| 45 | bool IsConstantSupportedCl(const TensorInfo& output, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 46 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 47 | |
| 48 | bool IsConvolution2dSupportedCl(const TensorInfo& input, |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 49 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 50 | const Convolution2dDescriptor& descriptor, |
| 51 | const TensorInfo& weights, |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 52 | const Optional<TensorInfo>& biases, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 53 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 54 | |
| 55 | bool IsDepthwiseConvolutionSupportedCl(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 56 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 57 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 58 | const TensorInfo& weights, |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 59 | const Optional<TensorInfo>& biases, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 60 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 61 | |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 62 | bool IsDivisionSupportedCl(const TensorInfo& input0, |
| 63 | const TensorInfo& input1, |
| 64 | const TensorInfo& output, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 65 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 66 | |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 67 | bool IsSubtractionSupportedCl(const TensorInfo& input0, |
| 68 | const TensorInfo& input1, |
| 69 | const TensorInfo& output, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 70 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 71 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 72 | bool IsFullyConnectedSupportedCl(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 73 | const TensorInfo& output, |
| 74 | const TensorInfo& weights, |
| 75 | const TensorInfo& biases, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 76 | const FullyConnectedDescriptor& descriptor, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 77 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 78 | |
| 79 | bool IsInputSupportedCl(const TensorInfo& input, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 80 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 81 | |
| 82 | bool IsL2NormalizationSupportedCl(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 83 | const TensorInfo& output, |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame] | 84 | const L2NormalizationDescriptor& descriptor, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 85 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 86 | |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 87 | bool IsLstmSupportedCl(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()); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 113 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 114 | bool IsMergerSupportedCl(const std::vector<const TensorInfo*> inputs, |
| 115 | const OriginsDescriptor& descriptor, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 116 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 117 | |
| 118 | bool IsMultiplicationSupportedCl(const TensorInfo& input0, |
| 119 | const TensorInfo& input1, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 120 | const TensorInfo& output, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 121 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 122 | |
| 123 | bool IsNormalizationSupportedCl(const TensorInfo& input, |
| 124 | const TensorInfo& output, |
| 125 | const NormalizationDescriptor& descriptor, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 126 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 127 | |
| 128 | bool IsOutputSupportedCl(const TensorInfo& output, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 129 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
jimfly01 | e1fa50c | 2018-09-21 12:09:51 +0100 | [diff] [blame] | 130 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 131 | bool IsPermuteSupportedCl(const TensorInfo& input, |
| 132 | const TensorInfo& output, |
| 133 | const PermuteDescriptor& descriptor, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 134 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 135 | |
| 136 | bool IsPooling2dSupportedCl(const TensorInfo& input, |
| 137 | const TensorInfo& output, |
| 138 | const Pooling2dDescriptor& descriptor, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 139 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 140 | |
| 141 | bool IsResizeBilinearSupportedCl(const TensorInfo& input, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 142 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 143 | |
| 144 | bool IsSoftmaxSupportedCl(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 145 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 146 | const SoftmaxDescriptor& descriptor, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 147 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 148 | |
| 149 | bool IsSplitterSupportedCl(const TensorInfo& input, |
| 150 | const ViewsDescriptor& descriptor, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 151 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 152 | |
| 153 | bool IsFakeQuantizationSupportedCl(const TensorInfo& input, |
| 154 | const FakeQuantizationDescriptor& descriptor, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 155 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 156 | |
| 157 | bool IsReshapeSupportedCl(const TensorInfo& input, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 158 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 159 | |
| 160 | bool IsFloorSupportedCl(const TensorInfo& input, |
| 161 | const TensorInfo& output, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 162 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
| 163 | |
| 164 | bool IsConvertFp16ToFp32SupportedCl(const TensorInfo& input, |
| 165 | const TensorInfo& output, |
| 166 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
| 167 | |
| 168 | bool IsConvertFp32ToFp16SupportedCl(const TensorInfo& input, |
| 169 | const TensorInfo& output, |
| 170 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 171 | |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 172 | bool IsMeanSupportedCl(const TensorInfo& input, |
| 173 | const TensorInfo& output, |
| 174 | const MeanDescriptor& descriptor, |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 175 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 176 | |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 177 | bool IsPadSupportedCl(const TensorInfo& input, |
| 178 | const TensorInfo& output, |
| 179 | const PadDescriptor& descriptor, |
| 180 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 181 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 182 | } |