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