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 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 7 | #include <backendsCommon/LayerSupportBase.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 8 | |
| 9 | namespace armnn |
| 10 | { |
| 11 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 12 | class NeonLayerSupport : public LayerSupportBase |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 13 | { |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 14 | public: |
| 15 | bool IsActivationSupported(const TensorInfo& input, |
| 16 | const TensorInfo& output, |
| 17 | const ActivationDescriptor& descriptor, |
| 18 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 19 | |
| 20 | bool IsAdditionSupported(const TensorInfo& input0, |
| 21 | const TensorInfo& input1, |
| 22 | const TensorInfo& output, |
| 23 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 24 | |
| 25 | bool IsBatchNormalizationSupported(const TensorInfo& input, |
| 26 | const TensorInfo& output, |
| 27 | const TensorInfo& mean, |
| 28 | const TensorInfo& var, |
| 29 | const TensorInfo& beta, |
| 30 | const TensorInfo& gamma, |
| 31 | const BatchNormalizationDescriptor& descriptor, |
| 32 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 33 | |
| 34 | bool IsConstantSupported(const TensorInfo& output, |
| 35 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 36 | |
| 37 | bool IsConvertFp16ToFp32Supported(const TensorInfo& input, |
| 38 | const TensorInfo& output, |
| 39 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 40 | |
| 41 | bool IsConvertFp32ToFp16Supported(const TensorInfo& input, |
| 42 | const TensorInfo& output, |
| 43 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 44 | |
| 45 | bool IsConvolution2dSupported(const TensorInfo& input, |
| 46 | const TensorInfo& output, |
| 47 | const Convolution2dDescriptor& descriptor, |
| 48 | const TensorInfo& weights, |
| 49 | const Optional<TensorInfo>& biases, |
| 50 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 51 | |
| 52 | bool IsDepthwiseConvolutionSupported(const TensorInfo& input, |
| 53 | const TensorInfo& output, |
| 54 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 55 | const TensorInfo& weights, |
| 56 | const Optional<TensorInfo>& biases, |
| 57 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 58 | |
Pablo Tello | f0bd683 | 2019-04-26 17:58:13 +0100 | [diff] [blame^] | 59 | bool IsDilatedDepthwiseConvolutionSupported(const TensorInfo& input, |
| 60 | const TensorInfo& output, |
| 61 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 62 | const TensorInfo& weights, |
| 63 | const Optional<TensorInfo>& biases, |
| 64 | Optional<std::string&> reason = EmptyOptional()) const override; |
| 65 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 66 | bool IsFloorSupported(const TensorInfo& input, |
| 67 | const TensorInfo& output, |
| 68 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 69 | |
| 70 | bool IsFullyConnectedSupported(const TensorInfo& input, |
| 71 | const TensorInfo& output, |
| 72 | const TensorInfo& weights, |
| 73 | const TensorInfo& biases, |
| 74 | const FullyConnectedDescriptor& descriptor, |
| 75 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 76 | |
kevmay01 | eed8592 | 2019-01-28 08:37:25 +0000 | [diff] [blame] | 77 | bool IsGreaterSupported(const TensorInfo& input0, |
| 78 | const TensorInfo& input1, |
| 79 | const TensorInfo& output, |
| 80 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 81 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 82 | bool IsInputSupported(const TensorInfo& input, |
| 83 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 84 | |
| 85 | bool IsL2NormalizationSupported(const TensorInfo& input, |
| 86 | const TensorInfo& output, |
| 87 | const L2NormalizationDescriptor& descriptor, |
| 88 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 89 | |
Nattapat Chaimanowong | 4e6597a | 2018-12-20 14:14:06 +0000 | [diff] [blame] | 90 | bool IsMaximumSupported(const TensorInfo& input0, |
| 91 | const TensorInfo& input1, |
| 92 | const TensorInfo& output, |
| 93 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 94 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 95 | bool IsMeanSupported(const TensorInfo& input, |
| 96 | const TensorInfo& output, |
| 97 | const MeanDescriptor& descriptor, |
| 98 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 99 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 100 | bool IsMemCopySupported(const TensorInfo& input, |
| 101 | const TensorInfo& output, |
| 102 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 103 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 104 | bool IsMergerSupported(const std::vector<const TensorInfo*> inputs, |
Nikhil Raj | 8599a41 | 2018-11-19 14:51:07 +0000 | [diff] [blame] | 105 | const TensorInfo& output, |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 106 | const OriginsDescriptor& descriptor, |
| 107 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 108 | |
Conor Kennedy | 54b2169 | 2019-01-09 07:57:38 +0000 | [diff] [blame] | 109 | bool IsMinimumSupported(const TensorInfo& input0, |
| 110 | const TensorInfo& input1, |
| 111 | const TensorInfo& output, |
| 112 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 113 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 114 | bool IsMultiplicationSupported(const TensorInfo& input0, |
| 115 | const TensorInfo& input1, |
| 116 | const TensorInfo& output, |
| 117 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 118 | |
| 119 | bool IsNormalizationSupported(const TensorInfo& input, |
| 120 | const TensorInfo& output, |
| 121 | const NormalizationDescriptor& descriptor, |
| 122 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 123 | |
| 124 | bool IsOutputSupported(const TensorInfo& output, |
| 125 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 126 | |
Éanna Ó Catháin | 1205574 | 2019-01-25 10:01:40 +0000 | [diff] [blame] | 127 | bool IsPadSupported(const TensorInfo& input, |
| 128 | const TensorInfo& output, |
| 129 | const PadDescriptor& descriptor, |
| 130 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 131 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 132 | bool IsPermuteSupported(const TensorInfo& input, |
| 133 | const TensorInfo& output, |
| 134 | const PermuteDescriptor& descriptor, |
| 135 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 136 | |
| 137 | bool IsPooling2dSupported(const TensorInfo& input, |
| 138 | const TensorInfo& output, |
| 139 | const Pooling2dDescriptor& descriptor, |
| 140 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 141 | |
| 142 | bool IsReshapeSupported(const TensorInfo& input, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 143 | const ReshapeDescriptor& descriptor, |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 144 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 145 | |
Sadik Armagan | c625f00 | 2018-12-17 11:32:16 +0000 | [diff] [blame] | 146 | bool IsResizeBilinearSupported(const TensorInfo& input, |
| 147 | const TensorInfo& output, |
| 148 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 149 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 150 | bool IsSoftmaxSupported(const TensorInfo& input, |
| 151 | const TensorInfo& output, |
| 152 | const SoftmaxDescriptor& descriptor, |
| 153 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 154 | |
| 155 | bool IsSplitterSupported(const TensorInfo& input, |
| 156 | const ViewsDescriptor& descriptor, |
| 157 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 158 | |
| 159 | bool IsSubtractionSupported(const TensorInfo& input0, |
| 160 | const TensorInfo& input1, |
| 161 | const TensorInfo& output, |
| 162 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 163 | }; // class NeonLayerSupport |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 164 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 165 | } // namespace armnn |