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 <layers/LstmLayer.hpp> |
| 11 | #include <boost/optional.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 12 | |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 13 | #include <boost/optional.hpp> |
| 14 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 15 | namespace armnn |
| 16 | { |
| 17 | |
| 18 | bool IsActivationSupportedRef(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 19 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 20 | const ActivationDescriptor& descriptor, |
| 21 | std::string* reasonIfUnsupported = nullptr); |
| 22 | |
| 23 | bool IsAdditionSupportedRef(const TensorInfo& input0, |
| 24 | const TensorInfo& input1, |
| 25 | const TensorInfo& output, |
| 26 | std::string* reasonIfUnsupported = nullptr); |
| 27 | |
| 28 | bool IsBatchNormalizationSupportedRef(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 29 | const TensorInfo& output, |
| 30 | const TensorInfo& mean, |
| 31 | const TensorInfo& var, |
| 32 | const TensorInfo& beta, |
| 33 | const TensorInfo& gamma, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 34 | const BatchNormalizationDescriptor& descriptor, |
| 35 | std::string* reasonIfUnsupported = nullptr); |
| 36 | |
| 37 | bool IsConstantSupportedRef(const TensorInfo& output, |
| 38 | std::string* reasonIfUnsupported = nullptr); |
| 39 | |
| 40 | bool IsConvolution2dSupportedRef(const TensorInfo& input, |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 41 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 42 | const Convolution2dDescriptor& descriptor, |
| 43 | const TensorInfo& weights, |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 44 | const boost::optional<TensorInfo>& biases, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 45 | std::string* reasonIfUnsupported = nullptr); |
| 46 | |
| 47 | bool IsDepthwiseConvolutionSupportedRef(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 48 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 49 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 50 | const TensorInfo& weights, |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 51 | const boost::optional<TensorInfo>& biases, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 52 | std::string* reasonIfUnsupported = nullptr); |
| 53 | |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 54 | bool IsDivisionSupportedRef(const TensorInfo& input0, |
| 55 | const TensorInfo& input1, |
| 56 | const TensorInfo& output, |
| 57 | std::string* reasonIfUnsupported = nullptr); |
| 58 | |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 59 | bool IsSubtractionSupportedRef(const TensorInfo& input0, |
| 60 | const TensorInfo& input1, |
| 61 | const TensorInfo& output, |
| 62 | std::string* reasonIfUnsupported = nullptr); |
| 63 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 64 | bool IsFullyConnectedSupportedRef(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 65 | const TensorInfo& output, |
| 66 | const TensorInfo& weights, |
| 67 | const TensorInfo& biases, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 68 | const FullyConnectedDescriptor& descriptor, |
| 69 | std::string* reasonIfUnsupported = nullptr); |
| 70 | |
| 71 | bool IsInputSupportedRef(const TensorInfo& input, |
| 72 | std::string* reasonIfUnsupported = nullptr); |
| 73 | |
| 74 | bool IsL2NormalizationSupportedRef(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 75 | const TensorInfo& output, |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame^] | 76 | const L2NormalizationDescriptor& descriptor, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 77 | std::string* reasonIfUnsupported = nullptr); |
| 78 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 79 | bool IsLstmSupportedRef(const TensorInfo& input, const TensorInfo& outputStateIn, |
| 80 | const TensorInfo& cellStateIn, const TensorInfo& scratchBuffer, |
| 81 | const TensorInfo& outputStateOut, const TensorInfo& cellStateOut, |
| 82 | const TensorInfo& output, const LstmDescriptor& descriptor, |
| 83 | const TensorInfo& inputToForgetWeights, const TensorInfo& inputToCellWeights, |
| 84 | const TensorInfo& inputToOutputWeights, const TensorInfo& recurrentToForgetWeights, |
| 85 | const TensorInfo& recurrentToCellWeights, const TensorInfo& recurrentToOutputWeights, |
| 86 | const TensorInfo& forgetGateBias, const TensorInfo& cellBias, |
| 87 | const TensorInfo& outputGateBias, const TensorInfo* inputToInputWeights, |
| 88 | const TensorInfo* recurrentToInputWeights, const TensorInfo* cellToInputWeights, |
| 89 | const TensorInfo* inputGateBias, const TensorInfo* projectionWeights, |
| 90 | const TensorInfo* projectionBias, const TensorInfo* cellToForgetWeights, |
| 91 | const TensorInfo* cellToOutputWeights, std::string* reasonIfUnsupported = nullptr); |
| 92 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 93 | bool IsMergerSupportedRef(const std::vector<const TensorInfo*> inputs, |
| 94 | const OriginsDescriptor& descriptor, |
| 95 | std::string* reasonIfUnsupported = nullptr); |
| 96 | |
| 97 | bool IsMultiplicationSupportedRef(const TensorInfo& input0, |
| 98 | const TensorInfo& input1, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 99 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 100 | std::string* reasonIfUnsupported = nullptr); |
| 101 | |
| 102 | bool IsNormalizationSupportedRef(const TensorInfo& input, |
| 103 | const TensorInfo& output, |
| 104 | const NormalizationDescriptor& descriptor, |
| 105 | std::string* reasonIfUnsupported = nullptr); |
| 106 | |
| 107 | bool IsOutputSupportedRef(const TensorInfo& output, |
| 108 | std::string* reasonIfUnsupported = nullptr); |
| 109 | |
| 110 | bool IsPermuteSupportedRef(const TensorInfo& input, |
| 111 | const TensorInfo& output, |
| 112 | const PermuteDescriptor& descriptor, |
| 113 | std::string* reasonIfUnsupported = nullptr); |
| 114 | |
| 115 | bool IsPooling2dSupportedRef(const TensorInfo& input, |
| 116 | const TensorInfo& output, |
| 117 | const Pooling2dDescriptor& descriptor, |
| 118 | std::string* reasonIfUnsupported = nullptr); |
| 119 | |
| 120 | bool IsResizeBilinearSupportedRef(const TensorInfo& input, |
| 121 | std::string* reasonIfUnsupported = nullptr); |
| 122 | |
| 123 | bool IsSoftmaxSupportedRef(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 124 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 125 | const SoftmaxDescriptor& descriptor, |
| 126 | std::string* reasonIfUnsupported = nullptr); |
| 127 | |
| 128 | bool IsSplitterSupportedRef(const TensorInfo& input, |
| 129 | const ViewsDescriptor& descriptor, |
| 130 | std::string* reasonIfUnsupported = nullptr); |
| 131 | |
| 132 | bool IsFakeQuantizationSupportedRef(const TensorInfo& input, |
| 133 | const FakeQuantizationDescriptor& descriptor, |
| 134 | std::string* reasonIfUnsupported = nullptr); |
| 135 | |
| 136 | bool IsReshapeSupportedRef(const TensorInfo& input, |
| 137 | std::string* reasonIfUnsupported = nullptr); |
| 138 | |
| 139 | bool IsFloorSupportedRef(const TensorInfo& input, |
| 140 | const TensorInfo& output, |
| 141 | std::string* reasonIfUnsupported = nullptr); |
| 142 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 143 | bool IsConvertFp16ToFp32SupportedRef(const TensorInfo& input, |
| 144 | const TensorInfo& output, |
| 145 | std::string* reasonIfUnsupported = nullptr); |
| 146 | |
| 147 | bool IsConvertFp32ToFp16SupportedRef(const TensorInfo& input, |
| 148 | const TensorInfo& output, |
| 149 | std::string* reasonIfUnsupported = nullptr); |
| 150 | |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 151 | bool IsMeanSupportedRef(const TensorInfo& input, |
| 152 | const TensorInfo& output, |
| 153 | const MeanDescriptor& descriptor, |
| 154 | std::string* reasonIfUnsupported = nullptr); |
| 155 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 156 | } |