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 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 59 | bool IsFloorSupported(const TensorInfo& input, |
| 60 | const TensorInfo& output, |
| 61 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 62 | |
| 63 | bool IsFullyConnectedSupported(const TensorInfo& input, |
| 64 | const TensorInfo& output, |
| 65 | const TensorInfo& weights, |
| 66 | const TensorInfo& biases, |
| 67 | const FullyConnectedDescriptor& descriptor, |
| 68 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 69 | |
| 70 | bool IsInputSupported(const TensorInfo& input, |
| 71 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 72 | |
| 73 | bool IsL2NormalizationSupported(const TensorInfo& input, |
| 74 | const TensorInfo& output, |
| 75 | const L2NormalizationDescriptor& descriptor, |
| 76 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 77 | |
Nattapat Chaimanowong | 4e6597a | 2018-12-20 14:14:06 +0000 | [diff] [blame] | 78 | bool IsMaximumSupported(const TensorInfo& input0, |
| 79 | const TensorInfo& input1, |
| 80 | const TensorInfo& output, |
| 81 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 82 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 83 | bool IsMeanSupported(const TensorInfo& input, |
| 84 | const TensorInfo& output, |
| 85 | const MeanDescriptor& descriptor, |
| 86 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 87 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 88 | bool IsMemCopySupported(const TensorInfo& input, |
| 89 | const TensorInfo& output, |
| 90 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 91 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 92 | bool IsMergerSupported(const std::vector<const TensorInfo*> inputs, |
Nikhil Raj | 8599a41 | 2018-11-19 14:51:07 +0000 | [diff] [blame] | 93 | const TensorInfo& output, |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 94 | const OriginsDescriptor& descriptor, |
| 95 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 96 | |
Conor Kennedy | 54b2169 | 2019-01-09 07:57:38 +0000 | [diff] [blame] | 97 | bool IsMinimumSupported(const TensorInfo& input0, |
| 98 | const TensorInfo& input1, |
| 99 | const TensorInfo& output, |
| 100 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 101 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 102 | bool IsMultiplicationSupported(const TensorInfo& input0, |
| 103 | const TensorInfo& input1, |
| 104 | const TensorInfo& output, |
| 105 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 106 | |
| 107 | bool IsNormalizationSupported(const TensorInfo& input, |
| 108 | const TensorInfo& output, |
| 109 | const NormalizationDescriptor& descriptor, |
| 110 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 111 | |
| 112 | bool IsOutputSupported(const TensorInfo& output, |
| 113 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 114 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 115 | bool IsPermuteSupported(const TensorInfo& input, |
| 116 | const TensorInfo& output, |
| 117 | const PermuteDescriptor& descriptor, |
| 118 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 119 | |
| 120 | bool IsPooling2dSupported(const TensorInfo& input, |
| 121 | const TensorInfo& output, |
| 122 | const Pooling2dDescriptor& descriptor, |
| 123 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 124 | |
| 125 | bool IsReshapeSupported(const TensorInfo& input, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 126 | const ReshapeDescriptor& descriptor, |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 127 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 128 | |
Sadik Armagan | c625f00 | 2018-12-17 11:32:16 +0000 | [diff] [blame] | 129 | bool IsResizeBilinearSupported(const TensorInfo& input, |
| 130 | const TensorInfo& output, |
| 131 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 132 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 133 | bool IsSoftmaxSupported(const TensorInfo& input, |
| 134 | const TensorInfo& output, |
| 135 | const SoftmaxDescriptor& descriptor, |
| 136 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 137 | |
| 138 | bool IsSplitterSupported(const TensorInfo& input, |
| 139 | const ViewsDescriptor& descriptor, |
| 140 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
| 141 | |
| 142 | bool IsSubtractionSupported(const TensorInfo& input0, |
| 143 | const TensorInfo& input1, |
| 144 | const TensorInfo& output, |
| 145 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 146 | }; // class NeonLayerSupport |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 147 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 148 | } // namespace armnn |