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> |
| 8 | #include <armnn/Types.hpp> |
| 9 | #include <armnn/Tensor.hpp> |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 10 | #include <armnn/ArmNN.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 11 | |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 12 | #include <boost/optional.hpp> |
| 13 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 14 | namespace armnn |
| 15 | { |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame^] | 16 | |
| 17 | class ClLayerSupport : public ILayerSupport |
| 18 | { |
| 19 | // TODO implement |
| 20 | }; |
| 21 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 22 | bool IsClDirectConvolution2dSupported(const TensorInfo& weightInfo, const Convolution2dDescriptor& desc); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 23 | bool IsClDepthwiseConvolution2dDescParamsSupported(std::string* reasonIfUnsupported, |
| 24 | const DepthwiseConvolution2dDescriptor& parameters, |
| 25 | const TensorInfo& weights); |
| 26 | |
| 27 | bool IsActivationSupportedCl(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 28 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 29 | const ActivationDescriptor& descriptor, |
| 30 | std::string* reasonIfUnsupported = nullptr); |
| 31 | |
| 32 | bool IsAdditionSupportedCl(const TensorInfo& input0, |
| 33 | const TensorInfo& input1, |
| 34 | const TensorInfo& output, |
| 35 | std::string* reasonIfUnsupported = nullptr); |
| 36 | |
| 37 | bool IsBatchNormalizationSupportedCl(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 38 | const TensorInfo& output, |
| 39 | const TensorInfo& mean, |
| 40 | const TensorInfo& var, |
| 41 | const TensorInfo& beta, |
| 42 | const TensorInfo& gamma, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 43 | const BatchNormalizationDescriptor& descriptor, |
| 44 | std::string* reasonIfUnsupported = nullptr); |
| 45 | |
| 46 | bool IsConstantSupportedCl(const TensorInfo& output, |
| 47 | std::string* reasonIfUnsupported = nullptr); |
| 48 | |
| 49 | bool IsConvolution2dSupportedCl(const TensorInfo& input, |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 50 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 51 | const Convolution2dDescriptor& descriptor, |
| 52 | const TensorInfo& weights, |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 53 | const boost::optional<TensorInfo>& biases, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 54 | std::string* reasonIfUnsupported = nullptr); |
| 55 | |
| 56 | bool IsDepthwiseConvolutionSupportedCl(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 57 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 58 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 59 | const TensorInfo& weights, |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 60 | const boost::optional<TensorInfo>& biases, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 61 | std::string* reasonIfUnsupported = nullptr); |
| 62 | |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 63 | bool IsDivisionSupportedCl(const TensorInfo& input0, |
| 64 | const TensorInfo& input1, |
| 65 | const TensorInfo& output, |
| 66 | std::string* reasonIfUnsupported = nullptr); |
| 67 | |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 68 | bool IsSubtractionSupportedCl(const TensorInfo& input0, |
| 69 | const TensorInfo& input1, |
| 70 | const TensorInfo& output, |
| 71 | std::string* reasonIfUnsupported = nullptr); |
| 72 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 73 | bool IsFullyConnectedSupportedCl(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 74 | const TensorInfo& output, |
| 75 | const TensorInfo& weights, |
| 76 | const TensorInfo& biases, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 77 | const FullyConnectedDescriptor& descriptor, |
| 78 | std::string* reasonIfUnsupported = nullptr); |
| 79 | |
| 80 | bool IsInputSupportedCl(const TensorInfo& input, |
| 81 | std::string* reasonIfUnsupported = nullptr); |
| 82 | |
| 83 | bool IsL2NormalizationSupportedCl(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 84 | const TensorInfo& output, |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame] | 85 | const L2NormalizationDescriptor& descriptor, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 86 | std::string* reasonIfUnsupported = nullptr); |
| 87 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 88 | bool IsLstmSupportedCl(const TensorInfo& input, const TensorInfo& outputStateIn, |
| 89 | const TensorInfo& cellStateIn, const TensorInfo& scratchBuffer, |
| 90 | const TensorInfo& outputStateOut, const TensorInfo& cellStateOut, |
| 91 | const TensorInfo& output, const LstmDescriptor& descriptor, |
| 92 | const TensorInfo& inputToForgetWeights, const TensorInfo& inputToCellWeights, |
| 93 | const TensorInfo& inputToOutputWeights, const TensorInfo& recurrentToForgetWeights, |
| 94 | const TensorInfo& recurrentToCellWeights, const TensorInfo& recurrentToOutputWeights, |
| 95 | const TensorInfo& forgetGateBias, const TensorInfo& cellBias, |
| 96 | const TensorInfo& outputGateBias, const TensorInfo* inputToInputWeights, |
| 97 | const TensorInfo* recurrentToInputWeights, const TensorInfo* cellToInputWeights, |
| 98 | const TensorInfo* inputGateBias, const TensorInfo* projectionWeights, |
| 99 | const TensorInfo* projectionBias, const TensorInfo* cellToForgetWeights, |
| 100 | const TensorInfo* cellToOutputWeights, std::string* reasonIfUnsupported = nullptr); |
| 101 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 102 | bool IsMergerSupportedCl(const std::vector<const TensorInfo*> inputs, |
| 103 | const OriginsDescriptor& descriptor, |
| 104 | std::string* reasonIfUnsupported = nullptr); |
| 105 | |
| 106 | bool IsMultiplicationSupportedCl(const TensorInfo& input0, |
| 107 | const TensorInfo& input1, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 108 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 109 | std::string* reasonIfUnsupported = nullptr); |
| 110 | |
| 111 | bool IsNormalizationSupportedCl(const TensorInfo& input, |
| 112 | const TensorInfo& output, |
| 113 | const NormalizationDescriptor& descriptor, |
| 114 | std::string* reasonIfUnsupported = nullptr); |
| 115 | |
| 116 | bool IsOutputSupportedCl(const TensorInfo& output, |
| 117 | std::string* reasonIfUnsupported = nullptr); |
| 118 | |
jimfly01 | e1fa50c | 2018-09-21 12:09:51 +0100 | [diff] [blame] | 119 | bool IsPadSupportedCl(const TensorInfo& input, |
| 120 | const TensorInfo& output, |
| 121 | const PadDescriptor& descriptor, |
| 122 | std::string* reasonIfUnsupported = nullptr); |
| 123 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 124 | bool IsPermuteSupportedCl(const TensorInfo& input, |
| 125 | const TensorInfo& output, |
| 126 | const PermuteDescriptor& descriptor, |
| 127 | std::string* reasonIfUnsupported = nullptr); |
| 128 | |
| 129 | bool IsPooling2dSupportedCl(const TensorInfo& input, |
| 130 | const TensorInfo& output, |
| 131 | const Pooling2dDescriptor& descriptor, |
| 132 | std::string* reasonIfUnsupported = nullptr); |
| 133 | |
| 134 | bool IsResizeBilinearSupportedCl(const TensorInfo& input, |
| 135 | std::string* reasonIfUnsupported = nullptr); |
| 136 | |
| 137 | bool IsSoftmaxSupportedCl(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 138 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 139 | const SoftmaxDescriptor& descriptor, |
| 140 | std::string* reasonIfUnsupported = nullptr); |
| 141 | |
| 142 | bool IsSplitterSupportedCl(const TensorInfo& input, |
| 143 | const ViewsDescriptor& descriptor, |
| 144 | std::string* reasonIfUnsupported = nullptr); |
| 145 | |
| 146 | bool IsFakeQuantizationSupportedCl(const TensorInfo& input, |
| 147 | const FakeQuantizationDescriptor& descriptor, |
| 148 | std::string* reasonIfUnsupported = nullptr); |
| 149 | |
| 150 | bool IsReshapeSupportedCl(const TensorInfo& input, |
| 151 | std::string* reasonIfUnsupported = nullptr); |
| 152 | |
| 153 | bool IsFloorSupportedCl(const TensorInfo& input, |
| 154 | const TensorInfo& output, |
| 155 | std::string* reasonIfUnsupported = nullptr); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 156 | |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 157 | bool IsMeanSupportedCl(const TensorInfo& input, |
| 158 | const TensorInfo& output, |
| 159 | const MeanDescriptor& descriptor, |
| 160 | std::string* reasonIfUnsupported = nullptr); |
| 161 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 162 | bool IsConvertFp16ToFp32SupportedCl(const TensorInfo& input, |
| 163 | const TensorInfo& output, |
| 164 | std::string* reasonIfUnsupported = nullptr); |
| 165 | |
| 166 | bool IsConvertFp32ToFp16SupportedCl(const TensorInfo& input, |
| 167 | const TensorInfo& output, |
| 168 | std::string* reasonIfUnsupported = nullptr); |
| 169 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 170 | } |