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, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 76 | std::string* reasonIfUnsupported = nullptr); |
| 77 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 78 | bool IsLstmSupportedRef(const TensorInfo& input, const TensorInfo& outputStateIn, |
| 79 | const TensorInfo& cellStateIn, const TensorInfo& scratchBuffer, |
| 80 | const TensorInfo& outputStateOut, const TensorInfo& cellStateOut, |
| 81 | const TensorInfo& output, const LstmDescriptor& descriptor, |
| 82 | const TensorInfo& inputToForgetWeights, const TensorInfo& inputToCellWeights, |
| 83 | const TensorInfo& inputToOutputWeights, const TensorInfo& recurrentToForgetWeights, |
| 84 | const TensorInfo& recurrentToCellWeights, const TensorInfo& recurrentToOutputWeights, |
| 85 | const TensorInfo& forgetGateBias, const TensorInfo& cellBias, |
| 86 | const TensorInfo& outputGateBias, const TensorInfo* inputToInputWeights, |
| 87 | const TensorInfo* recurrentToInputWeights, const TensorInfo* cellToInputWeights, |
| 88 | const TensorInfo* inputGateBias, const TensorInfo* projectionWeights, |
| 89 | const TensorInfo* projectionBias, const TensorInfo* cellToForgetWeights, |
| 90 | const TensorInfo* cellToOutputWeights, std::string* reasonIfUnsupported = nullptr); |
| 91 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 92 | bool IsMergerSupportedRef(const std::vector<const TensorInfo*> inputs, |
| 93 | const OriginsDescriptor& descriptor, |
| 94 | std::string* reasonIfUnsupported = nullptr); |
| 95 | |
| 96 | bool IsMultiplicationSupportedRef(const TensorInfo& input0, |
| 97 | const TensorInfo& input1, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 98 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 99 | std::string* reasonIfUnsupported = nullptr); |
| 100 | |
| 101 | bool IsNormalizationSupportedRef(const TensorInfo& input, |
| 102 | const TensorInfo& output, |
| 103 | const NormalizationDescriptor& descriptor, |
| 104 | std::string* reasonIfUnsupported = nullptr); |
| 105 | |
| 106 | bool IsOutputSupportedRef(const TensorInfo& output, |
| 107 | std::string* reasonIfUnsupported = nullptr); |
| 108 | |
| 109 | bool IsPermuteSupportedRef(const TensorInfo& input, |
| 110 | const TensorInfo& output, |
| 111 | const PermuteDescriptor& descriptor, |
| 112 | std::string* reasonIfUnsupported = nullptr); |
| 113 | |
| 114 | bool IsPooling2dSupportedRef(const TensorInfo& input, |
| 115 | const TensorInfo& output, |
| 116 | const Pooling2dDescriptor& descriptor, |
| 117 | std::string* reasonIfUnsupported = nullptr); |
| 118 | |
| 119 | bool IsResizeBilinearSupportedRef(const TensorInfo& input, |
| 120 | std::string* reasonIfUnsupported = nullptr); |
| 121 | |
| 122 | bool IsSoftmaxSupportedRef(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 123 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 124 | const SoftmaxDescriptor& descriptor, |
| 125 | std::string* reasonIfUnsupported = nullptr); |
| 126 | |
| 127 | bool IsSplitterSupportedRef(const TensorInfo& input, |
| 128 | const ViewsDescriptor& descriptor, |
| 129 | std::string* reasonIfUnsupported = nullptr); |
| 130 | |
| 131 | bool IsFakeQuantizationSupportedRef(const TensorInfo& input, |
| 132 | const FakeQuantizationDescriptor& descriptor, |
| 133 | std::string* reasonIfUnsupported = nullptr); |
| 134 | |
| 135 | bool IsReshapeSupportedRef(const TensorInfo& input, |
| 136 | std::string* reasonIfUnsupported = nullptr); |
| 137 | |
| 138 | bool IsFloorSupportedRef(const TensorInfo& input, |
| 139 | const TensorInfo& output, |
| 140 | std::string* reasonIfUnsupported = nullptr); |
| 141 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 142 | bool IsConvertFp16ToFp32SupportedRef(const TensorInfo& input, |
| 143 | const TensorInfo& output, |
| 144 | std::string* reasonIfUnsupported = nullptr); |
| 145 | |
| 146 | bool IsConvertFp32ToFp16SupportedRef(const TensorInfo& input, |
| 147 | const TensorInfo& output, |
| 148 | std::string* reasonIfUnsupported = nullptr); |
| 149 | |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 150 | bool IsMeanSupportedRef(const TensorInfo& input, |
| 151 | const TensorInfo& output, |
| 152 | const MeanDescriptor& descriptor, |
| 153 | std::string* reasonIfUnsupported = nullptr); |
| 154 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 155 | } |