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> |
| 10 | |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 11 | #include <boost/optional.hpp> |
| 12 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 13 | namespace armnn |
| 14 | { |
| 15 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 16 | bool IsNeonDirectConvolutionPreferred(const TensorInfo& weightInfo, const Convolution2dDescriptor& desc); |
| 17 | |
| 18 | bool IsNeonNormalizationDescParamsSupported(std::string* reasonIfUnsupported, |
| 19 | const NormalizationDescriptor& parameters); |
| 20 | |
| 21 | bool IsActivationSupportedNeon(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); |
| 25 | |
| 26 | bool IsNeonDepthwiseConvolution2dDescParamsSupported(std::string* reasonIfUnsupported, |
| 27 | const DepthwiseConvolution2dDescriptor& parameters, |
| 28 | const TensorInfo& weights); |
| 29 | |
| 30 | bool IsAdditionSupportedNeon(const TensorInfo& input0, |
| 31 | const TensorInfo& input1, |
| 32 | const TensorInfo& output, |
| 33 | std::string* reasonIfUnsupported); |
| 34 | |
| 35 | bool IsBatchNormalizationSupportedNeon(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 36 | const TensorInfo& output, |
| 37 | const TensorInfo& mean, |
| 38 | const TensorInfo& var, |
| 39 | const TensorInfo& beta, |
| 40 | const TensorInfo& gamma, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 41 | const BatchNormalizationDescriptor& descriptor, |
| 42 | std::string* reasonIfUnsupported = nullptr); |
| 43 | |
| 44 | bool IsConstantSupportedNeon(const TensorInfo& output, |
| 45 | std::string* reasonIfUnsupported = nullptr); |
| 46 | |
| 47 | bool IsConvolution2dSupportedNeon(const TensorInfo& input, |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 48 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 49 | const Convolution2dDescriptor& 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 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 54 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 55 | bool IsDepthwiseConvolutionSupportedNeon(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, |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 59 | const boost::optional<TensorInfo>& biases, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 60 | std::string* reasonIfUnsupported = nullptr); |
| 61 | |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 62 | bool IsDivisionSupportedNeon(const TensorInfo& input0, |
| 63 | const TensorInfo& input1, |
| 64 | const TensorInfo& output, |
| 65 | std::string* reasonIfUnsupported = nullptr); |
| 66 | |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 67 | bool IsSubtractionSupportedNeon(const TensorInfo& input0, |
| 68 | const TensorInfo& input1, |
| 69 | const TensorInfo& output, |
| 70 | std::string* reasonIfUnsupported = nullptr); |
| 71 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 72 | bool IsFullyConnectedSupportedNeon(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, |
| 77 | std::string* reasonIfUnsupported = nullptr); |
| 78 | |
| 79 | bool IsInputSupportedNeon(const TensorInfo& input, |
| 80 | std::string* reasonIfUnsupported = nullptr); |
| 81 | |
| 82 | bool IsL2NormalizationSupportedNeon(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 83 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 84 | std::string* reasonIfUnsupported = nullptr); |
| 85 | |
| 86 | bool IsMergerSupportedNeon(const std::vector<const TensorInfo*> inputs, |
| 87 | const OriginsDescriptor& descriptor, |
| 88 | std::string* reasonIfUnsupported = nullptr); |
| 89 | |
| 90 | bool IsMultiplicationSupportedNeon(const TensorInfo& input0, |
| 91 | const TensorInfo& input1, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 92 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 93 | std::string* reasonIfUnsupported = nullptr); |
| 94 | |
| 95 | bool IsNormalizationSupportedNeon(const TensorInfo& input, |
| 96 | const TensorInfo& output, |
| 97 | const NormalizationDescriptor& descriptor, |
| 98 | std::string* reasonIfUnsupported = nullptr); |
| 99 | |
| 100 | bool IsOutputSupportedNeon(const TensorInfo& output, |
| 101 | std::string* reasonIfUnsupported = nullptr); |
| 102 | |
| 103 | bool IsPermuteSupportedNeon(const TensorInfo& input, |
| 104 | const TensorInfo& output, |
| 105 | const PermuteDescriptor& descriptor, |
| 106 | std::string* reasonIfUnsupported = nullptr); |
| 107 | |
| 108 | bool IsPooling2dSupportedNeon(const TensorInfo& input, |
| 109 | const TensorInfo& output, |
| 110 | const Pooling2dDescriptor& descriptor, |
| 111 | std::string* reasonIfUnsupported = nullptr); |
| 112 | |
| 113 | bool IsResizeBilinearSupportedNeon(const TensorInfo& input, |
| 114 | std::string* reasonIfUnsupported = nullptr); |
| 115 | |
| 116 | bool IsSoftmaxSupportedNeon(const TensorInfo& input, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 117 | const TensorInfo& output, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 118 | const SoftmaxDescriptor& descriptor, |
| 119 | std::string* reasonIfUnsupported = nullptr); |
| 120 | |
| 121 | bool IsSplitterSupportedNeon(const TensorInfo& input, |
| 122 | const ViewsDescriptor& descriptor, |
| 123 | std::string* reasonIfUnsupported = nullptr); |
| 124 | |
| 125 | bool IsFakeQuantizationSupportedNeon(const TensorInfo& input, |
| 126 | const FakeQuantizationDescriptor& descriptor, |
| 127 | std::string* reasonIfUnsupported = nullptr); |
| 128 | |
| 129 | bool IsReshapeSupportedNeon(const TensorInfo& input, |
| 130 | std::string* reasonIfUnsupported = nullptr); |
| 131 | |
| 132 | bool IsFloorSupportedNeon(const TensorInfo& input, |
| 133 | const TensorInfo& output, |
| 134 | std::string* reasonIfUnsupported = nullptr); |
| 135 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 136 | bool IsLstmSupportedNeon(const TensorInfo& input, const TensorInfo& outputStateIn, |
| 137 | const TensorInfo& cellStateIn, const TensorInfo& scratchBuffer, |
| 138 | const TensorInfo& outputStateOut, const TensorInfo& cellStateOut, |
| 139 | const TensorInfo& output, const LstmDescriptor& descriptor, |
| 140 | const TensorInfo& inputToForgetWeights, const TensorInfo& inputToCellWeights, |
| 141 | const TensorInfo& inputToOutputWeights, const TensorInfo& recurrentToForgetWeights, |
| 142 | const TensorInfo& recurrentToCellWeights, const TensorInfo& recurrentToOutputWeights, |
| 143 | const TensorInfo& forgetGateBias, const TensorInfo& cellBias, |
| 144 | const TensorInfo& outputGateBias, const TensorInfo* inputToInputWeights, |
| 145 | const TensorInfo* recurrentToInputWeights, const TensorInfo* cellToInputWeights, |
| 146 | const TensorInfo* inputGateBias, const TensorInfo* projectionWeights, |
| 147 | const TensorInfo* projectionBias, const TensorInfo* cellToForgetWeights, |
| 148 | const TensorInfo* cellToOutputWeights, std::string* reasonIfUnsupported = nullptr); |
| 149 | |
| 150 | bool IsConvertFp16ToFp32SupportedNeon(const TensorInfo& input, |
| 151 | const TensorInfo& output, |
| 152 | std::string* reasonIfUnsupported = nullptr); |
| 153 | |
| 154 | bool IsConvertFp32ToFp16SupportedNeon(const TensorInfo& input, |
| 155 | const TensorInfo& output, |
| 156 | std::string* reasonIfUnsupported = nullptr); |
| 157 | |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 158 | bool IsMeanSupportedNeon(const TensorInfo& input, |
| 159 | const TensorInfo& output, |
| 160 | const MeanDescriptor& descriptor, |
| 161 | std::string* reasonIfUnsupported = nullptr); |
| 162 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 163 | } |