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 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 6 | #include "ClLayerSupport.hpp" |
David Beck | 3e9e115 | 2018-10-17 14:17:50 +0100 | [diff] [blame] | 7 | #include "ClBackendId.hpp" |
arovir01 | 7c22c70 | 2018-10-09 11:16:46 +0100 | [diff] [blame] | 8 | |
David Beck | 3cc9a62 | 2018-10-12 10:38:31 +0100 | [diff] [blame] | 9 | #include <armnn/Descriptors.hpp> |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 10 | #include <InternalTypes.hpp> |
| 11 | #include <LayerSupportCommon.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 12 | |
David Beck | 111b5d9 | 2018-11-12 14:59:37 +0000 | [diff] [blame] | 13 | #include <backendsCommon/BackendRegistry.hpp> |
David Beck | 3e9e115 | 2018-10-17 14:17:50 +0100 | [diff] [blame] | 14 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 15 | #include <boost/core/ignore_unused.hpp> |
| 16 | |
Matteo Martincigh | d95e906 | 2019-01-31 15:35:59 +0000 | [diff] [blame] | 17 | #if defined(ARMCOMPUTECL_ENABLED) |
Narumol Prangnawarat | 7413583 | 2019-05-23 15:07:33 +0100 | [diff] [blame] | 18 | #include <aclCommon/ArmComputeUtils.hpp> |
David Beck | ac42efd | 2018-09-26 17:41:13 +0100 | [diff] [blame] | 19 | #include "workloads/ClAdditionWorkload.hpp" |
Nattapat Chaimanowong | e06757e | 2018-10-11 15:39:18 +0100 | [diff] [blame] | 20 | #include "workloads/ClActivationWorkload.hpp" |
David Beck | ac42efd | 2018-09-26 17:41:13 +0100 | [diff] [blame] | 21 | #include "workloads/ClBatchNormalizationFloatWorkload.hpp" |
Mike Kelly | 831faed | 2018-11-28 11:52:08 +0000 | [diff] [blame] | 22 | #include "workloads/ClBatchToSpaceNdWorkload.hpp" |
David Beck | ac42efd | 2018-09-26 17:41:13 +0100 | [diff] [blame] | 23 | #include "workloads/ClConvertFp16ToFp32Workload.hpp" |
| 24 | #include "workloads/ClConvertFp32ToFp16Workload.hpp" |
Matthew Bentham | d806792 | 2018-10-03 17:18:04 +0100 | [diff] [blame] | 25 | #include "workloads/ClConvolution2dWorkload.hpp" |
Jim Flynn | 983daec | 2019-05-29 16:20:16 +0100 | [diff] [blame^] | 26 | #include "workloads/ClDequantizeWorkload.hpp" |
Matthew Bentham | d877739 | 2018-10-08 09:38:55 +0100 | [diff] [blame] | 27 | #include "workloads/ClDepthwiseConvolutionWorkload.hpp" |
David Beck | ac42efd | 2018-09-26 17:41:13 +0100 | [diff] [blame] | 28 | #include "workloads/ClDivisionFloatWorkload.hpp" |
David Beck | ac42efd | 2018-09-26 17:41:13 +0100 | [diff] [blame] | 29 | #include "workloads/ClFullyConnectedWorkload.hpp" |
Nattapat Chaimanowong | c6a41ff | 2019-01-29 09:56:02 +0000 | [diff] [blame] | 30 | #include "workloads/ClGreaterWorkload.hpp" |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 31 | #include "workloads/ClL2NormalizationFloatWorkload.hpp" |
| 32 | #include "workloads/ClLstmFloatWorkload.hpp" |
keidav01 | a959ee5 | 2018-12-19 10:04:58 +0000 | [diff] [blame] | 33 | #include "workloads/ClMaximumWorkload.hpp" |
Matteo Martincigh | 28dcab6 | 2018-10-19 16:40:03 +0100 | [diff] [blame] | 34 | #include "workloads/ClMeanWorkload.hpp" |
Jim Flynn | 6905941 | 2019-05-17 13:03:57 +0100 | [diff] [blame] | 35 | #include "workloads/ClConcatWorkload.hpp" |
saoste01 | 9292aa3 | 2019-01-08 13:55:59 +0000 | [diff] [blame] | 36 | #include "workloads/ClMinimumWorkload.hpp" |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 37 | #include "workloads/ClMultiplicationWorkload.hpp" |
David Beck | ac42efd | 2018-09-26 17:41:13 +0100 | [diff] [blame] | 38 | #include "workloads/ClNormalizationFloatWorkload.hpp" |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 39 | #include "workloads/ClPadWorkload.hpp" |
| 40 | #include "workloads/ClPermuteWorkload.hpp" |
Nattapat Chaimanowong | ac9e096 | 2018-10-10 17:18:35 +0100 | [diff] [blame] | 41 | #include "workloads/ClPooling2dWorkload.hpp" |
Sadik Armagan | 20ec249 | 2019-05-31 09:09:44 +0100 | [diff] [blame] | 42 | #include "workloads/ClQuantizeWorkload.hpp" |
David Beck | ac42efd | 2018-09-26 17:41:13 +0100 | [diff] [blame] | 43 | #include "workloads/ClSoftmaxBaseWorkload.hpp" |
Sadik Armagan | f446432 | 2018-12-20 16:19:12 +0000 | [diff] [blame] | 44 | #include "workloads/ClSpaceToBatchNdWorkload.hpp" |
Narumol Prangnawarat | 7413583 | 2019-05-23 15:07:33 +0100 | [diff] [blame] | 45 | #include "workloads/ClSplitterWorkload.hpp" |
keidav01 | d74dc91 | 2018-12-10 18:16:07 +0000 | [diff] [blame] | 46 | #include "workloads/ClStridedSliceWorkload.hpp" |
David Beck | ac42efd | 2018-09-26 17:41:13 +0100 | [diff] [blame] | 47 | #include "workloads/ClSubtractionWorkload.hpp" |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 48 | #endif |
| 49 | |
| 50 | using namespace boost; |
| 51 | |
| 52 | namespace armnn |
| 53 | { |
arovir01 | 7c22c70 | 2018-10-09 11:16:46 +0100 | [diff] [blame] | 54 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 55 | namespace |
| 56 | { |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 57 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 58 | template<unsigned int FilterSize> |
| 59 | bool IsMatchingSize2d(const TensorInfo& weightInfo) |
| 60 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 61 | // Width & Height must match. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 62 | return (weightInfo.GetShape()[3] == FilterSize) && (weightInfo.GetShape()[2] == FilterSize); |
| 63 | } |
| 64 | |
| 65 | template<uint32_t ValidStride> |
| 66 | bool IsMatchingStride(uint32_t actualStride) |
| 67 | { |
| 68 | return ValidStride == actualStride; |
| 69 | } |
| 70 | |
| 71 | template<uint32_t FirstStride, uint32_t SecondStride, uint32_t... ValidStrides> |
| 72 | bool IsMatchingStride(uint32_t actualStride) |
| 73 | { |
| 74 | return IsMatchingStride<FirstStride>(actualStride) || IsMatchingStride<SecondStride, ValidStrides...>(actualStride); |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 75 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 76 | |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 77 | bool IsClBackendSupported(Optional<std::string&> reasonIfUnsupported) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 78 | { |
Matteo Martincigh | d95e906 | 2019-01-31 15:35:59 +0000 | [diff] [blame] | 79 | #if defined(ARMCOMPUTECL_ENABLED) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 80 | return true; |
| 81 | #else |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 82 | if (reasonIfUnsupported) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 83 | { |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 84 | reasonIfUnsupported.value() = "The armnn library has been built without CL support"; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 85 | } |
| 86 | return false; |
| 87 | #endif |
| 88 | } |
| 89 | |
Matteo Martincigh | d95e906 | 2019-01-31 15:35:59 +0000 | [diff] [blame] | 90 | #if defined(ARMCOMPUTECL_ENABLED) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 91 | #define FORWARD_CL_LAYER_SUPPORT_FUNC(expr) (expr) |
| 92 | #else |
| 93 | #define FORWARD_CL_LAYER_SUPPORT_FUNC(expr) IsClBackendSupported(reasonIfUnsupported) |
| 94 | #endif |
| 95 | |
Matteo Martincigh | d95e906 | 2019-01-31 15:35:59 +0000 | [diff] [blame] | 96 | #if defined(ARMCOMPUTECL_ENABLED) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 97 | template<class FuncType, class... Args> |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 98 | inline bool IsWorkloadSupported(FuncType&& func, Optional<std::string&> reasonIfUnsupported, Args&&... args) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 99 | { |
| 100 | arm_compute::Status aclStatus = func(std::forward<Args>(args)...); |
| 101 | const bool supported = (aclStatus.error_code() == arm_compute::ErrorCode::OK); |
| 102 | if (!supported && reasonIfUnsupported) |
| 103 | { |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 104 | reasonIfUnsupported.value() = aclStatus.error_description(); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 105 | } |
| 106 | return supported; |
| 107 | } |
| 108 | |
| 109 | #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \ |
| 110 | return IsWorkloadSupported(func, reasonIfUnsupported, __VA_ARGS__); |
| 111 | #else |
| 112 | #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \ |
| 113 | return IsClBackendSupported(reasonIfUnsupported); |
| 114 | #endif |
| 115 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 116 | template<typename FloatFunc, typename Uint8Func, typename ... Params> |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 117 | bool IsSupportedForDataTypeCl(Optional<std::string&> reasonIfUnsupported, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 118 | DataType dataType, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 119 | FloatFunc floatFuncPtr, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 120 | Uint8Func uint8FuncPtr, |
| 121 | Params&&... params) |
| 122 | { |
| 123 | return IsClBackendSupported(reasonIfUnsupported) && |
| 124 | IsSupportedForDataTypeGeneric(reasonIfUnsupported, |
| 125 | dataType, |
| 126 | floatFuncPtr, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 127 | floatFuncPtr, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 128 | uint8FuncPtr, |
narpra01 | db2b160 | 2019-01-23 15:23:11 +0000 | [diff] [blame] | 129 | &FalseFunc<>, |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 130 | &FalseFunc<>, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 131 | std::forward<Params>(params)...); |
| 132 | } |
| 133 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 134 | } // anonymous namespace |
| 135 | |
| 136 | bool ClLayerSupport::IsActivationSupported(const TensorInfo& input, |
| 137 | const TensorInfo& output, |
| 138 | const ActivationDescriptor& descriptor, |
| 139 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 140 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 141 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClActivationWorkloadValidate, |
| 142 | reasonIfUnsupported, |
| 143 | input, |
| 144 | output, |
| 145 | descriptor); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 146 | } |
| 147 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 148 | bool ClLayerSupport::IsAdditionSupported(const TensorInfo& input0, |
| 149 | const TensorInfo& input1, |
| 150 | const TensorInfo& output, |
| 151 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 152 | { |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 153 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClAdditionValidate, |
| 154 | reasonIfUnsupported, |
| 155 | input0, |
| 156 | input1, |
| 157 | output); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 158 | } |
| 159 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 160 | bool ClLayerSupport::IsBatchNormalizationSupported(const TensorInfo& input, |
| 161 | const TensorInfo& output, |
| 162 | const TensorInfo& mean, |
| 163 | const TensorInfo& var, |
| 164 | const TensorInfo& beta, |
| 165 | const TensorInfo& gamma, |
| 166 | const BatchNormalizationDescriptor& descriptor, |
| 167 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 168 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 169 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClBatchNormalizationValidate, |
| 170 | reasonIfUnsupported, |
| 171 | input, |
| 172 | output, |
| 173 | mean, |
| 174 | var, |
| 175 | beta, |
| 176 | gamma, |
| 177 | descriptor); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 178 | } |
| 179 | |
Mike Kelly | 831faed | 2018-11-28 11:52:08 +0000 | [diff] [blame] | 180 | bool ClLayerSupport::IsBatchToSpaceNdSupported(const TensorInfo& input, |
| 181 | const TensorInfo& output, |
| 182 | const BatchToSpaceNdDescriptor& descriptor, |
| 183 | Optional<std::string&> reasonIfUnsupported) const |
| 184 | { |
| 185 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClBatchToSpaceNdWorkloadValidate, |
| 186 | reasonIfUnsupported, |
| 187 | input, |
| 188 | output, |
| 189 | descriptor); |
| 190 | } |
| 191 | |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 192 | bool ClLayerSupport::IsConcatSupported(const std::vector<const TensorInfo*> inputs, |
| 193 | const TensorInfo& output, |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 194 | const ConcatDescriptor& descriptor, |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 195 | Optional<std::string&> reasonIfUnsupported) const |
| 196 | { |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 197 | if (descriptor.GetNumDimensions() <= descriptor.GetConcatAxis()) |
| 198 | { |
| 199 | SetValueChecked(reasonIfUnsupported, "Cl Concat: Concat axis > Number of dimensions."); |
| 200 | return false; |
| 201 | } |
| 202 | |
| 203 | unsigned int concatInnerAxis = (descriptor.GetNumDimensions() - descriptor.GetConcatAxis()) - 1; |
| 204 | if(concatInnerAxis < 3) // Width, height, or channels |
| 205 | { |
| 206 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClConcatWorkloadValidate, |
| 207 | reasonIfUnsupported, |
| 208 | inputs, |
| 209 | output, |
| 210 | descriptor); |
| 211 | } |
| 212 | else if (concatInnerAxis == 3) |
| 213 | { |
| 214 | // We rely on the sub-tensor optimization to handle the batch dimension for 4D tensors. If we can't use |
| 215 | // sub-tensors for this then we can't support it. Here is where we check that the sub-tensors will work. |
| 216 | for (auto& input : inputs) |
| 217 | { |
| 218 | if (input && !output.IsTypeSpaceMatch(*input)) // Cannot use sub-tensors if the types are not same space |
| 219 | { |
| 220 | SetValueChecked(reasonIfUnsupported, "Cl Concat: Types and quantization parameters must match."); |
| 221 | return false; |
| 222 | } |
| 223 | } |
| 224 | return true; // Sub-tensors support concat along batch |
| 225 | } |
| 226 | else // > 4 dimensions not supported. |
| 227 | { |
| 228 | SetValueChecked(reasonIfUnsupported, "Cl Concat: Maximum of 4 dimensions supported."); |
| 229 | return false; |
| 230 | } |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 231 | } |
| 232 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 233 | bool ClLayerSupport::IsConstantSupported(const TensorInfo& output, |
| 234 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 235 | { |
| 236 | return IsSupportedForDataTypeCl(reasonIfUnsupported, |
| 237 | output.GetDataType(), |
| 238 | &TrueFunc<>, |
| 239 | &FalseFuncU8<>); |
| 240 | } |
| 241 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 242 | bool ClLayerSupport::IsConvertFp16ToFp32Supported(const TensorInfo& input, |
| 243 | const TensorInfo& output, |
| 244 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 245 | { |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 246 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClConvertFp16ToFp32WorkloadValidate, |
| 247 | reasonIfUnsupported, |
| 248 | input, |
| 249 | output); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 250 | } |
| 251 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 252 | bool ClLayerSupport::IsConvertFp32ToFp16Supported(const TensorInfo& input, |
| 253 | const TensorInfo& output, |
| 254 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 255 | { |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 256 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClConvertFp32ToFp16WorkloadValidate, |
| 257 | reasonIfUnsupported, |
| 258 | input, |
| 259 | output); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 260 | } |
| 261 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 262 | bool ClLayerSupport::IsConvolution2dSupported(const TensorInfo& input, |
| 263 | const TensorInfo& output, |
| 264 | const Convolution2dDescriptor& descriptor, |
| 265 | const TensorInfo& weights, |
| 266 | const Optional<TensorInfo>& biases, |
| 267 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 268 | { |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 269 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClConvolution2dWorkloadValidate, |
| 270 | reasonIfUnsupported, |
| 271 | input, |
| 272 | output, |
| 273 | descriptor, |
| 274 | weights, |
| 275 | biases); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 276 | } |
| 277 | |
Jim Flynn | 983daec | 2019-05-29 16:20:16 +0100 | [diff] [blame^] | 278 | bool ClLayerSupport::IsDequantizeSupported(const TensorInfo& input, |
| 279 | const TensorInfo& output, |
| 280 | Optional<std::string&> reasonIfUnsupported) const |
| 281 | { |
| 282 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClDequantizeWorkloadValidate, |
| 283 | reasonIfUnsupported, |
| 284 | input, |
| 285 | output); |
| 286 | } |
| 287 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 288 | bool ClLayerSupport::IsDepthwiseConvolutionSupported(const TensorInfo& input, |
| 289 | const TensorInfo& output, |
| 290 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 291 | const TensorInfo& weights, |
| 292 | const Optional<TensorInfo>& biases, |
| 293 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 294 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 295 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClDepthwiseConvolutionWorkloadValidate, |
| 296 | reasonIfUnsupported, |
| 297 | input, |
| 298 | output, |
| 299 | descriptor, |
| 300 | weights, |
| 301 | biases); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 302 | } |
| 303 | |
Pablo Tello | f0bd683 | 2019-04-26 17:58:13 +0100 | [diff] [blame] | 304 | bool ClLayerSupport::IsDilatedDepthwiseConvolutionSupported(const TensorInfo& input, |
| 305 | const TensorInfo& output, |
| 306 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 307 | const TensorInfo& weights, |
| 308 | const Optional<TensorInfo>& biases, |
| 309 | Optional<std::string&> reasonIfUnsupported) const |
| 310 | { |
| 311 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClDepthwiseConvolutionWorkloadValidate, |
| 312 | reasonIfUnsupported, |
| 313 | input, |
| 314 | output, |
| 315 | descriptor, |
| 316 | weights, |
| 317 | biases); |
| 318 | } |
| 319 | |
| 320 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 321 | bool ClLayerSupport::IsDivisionSupported(const TensorInfo& input0, |
| 322 | const TensorInfo& input1, |
| 323 | const TensorInfo& output, |
| 324 | Optional<std::string&> reasonIfUnsupported) const |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 325 | { |
| 326 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClDivisionWorkloadValidate, |
| 327 | reasonIfUnsupported, |
| 328 | input0, |
| 329 | input1, |
| 330 | output); |
| 331 | } |
| 332 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 333 | bool ClLayerSupport::IsFloorSupported(const TensorInfo& input, |
| 334 | const TensorInfo& output, |
| 335 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 336 | { |
| 337 | ignore_unused(output); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 338 | return IsClBackendSupported(reasonIfUnsupported) && |
| 339 | IsSupportedForDataTypeGeneric(reasonIfUnsupported, |
| 340 | input.GetDataType(), |
| 341 | &FalseFuncF16<>, |
| 342 | &TrueFunc<>, |
narpra01 | db2b160 | 2019-01-23 15:23:11 +0000 | [diff] [blame] | 343 | &FalseFuncU8<>, |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 344 | &FalseFuncI32<>, |
| 345 | &FalseFuncU8<>); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 346 | } |
| 347 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 348 | bool ClLayerSupport::IsFullyConnectedSupported(const TensorInfo& input, |
| 349 | const TensorInfo& output, |
| 350 | const TensorInfo& weights, |
| 351 | const TensorInfo& biases, |
| 352 | const FullyConnectedDescriptor& descriptor, |
| 353 | Optional<std::string&> reasonIfUnsupported) const |
| 354 | { |
| 355 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClFullyConnectedWorkloadValidate, |
| 356 | reasonIfUnsupported, |
| 357 | input, |
| 358 | output, |
| 359 | weights, |
| 360 | biases, |
| 361 | descriptor); |
| 362 | } |
| 363 | |
Nattapat Chaimanowong | c6a41ff | 2019-01-29 09:56:02 +0000 | [diff] [blame] | 364 | bool ClLayerSupport::IsGreaterSupported(const TensorInfo& input0, |
| 365 | const TensorInfo& input1, |
| 366 | const TensorInfo& output, |
| 367 | Optional<std::string&> reasonIfUnsupported) const |
| 368 | { |
| 369 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClGreaterWorkloadValidate, |
| 370 | reasonIfUnsupported, |
| 371 | input0, |
| 372 | input1, |
| 373 | output); |
| 374 | } |
| 375 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 376 | bool ClLayerSupport::IsInputSupported(const TensorInfo& input, |
| 377 | Optional<std::string&> reasonIfUnsupported) const |
| 378 | { |
| 379 | return IsSupportedForDataTypeCl(reasonIfUnsupported, |
| 380 | input.GetDataType(), |
| 381 | &TrueFunc<>, |
| 382 | &TrueFunc<>); |
| 383 | } |
| 384 | |
| 385 | bool ClLayerSupport::IsL2NormalizationSupported(const TensorInfo& input, |
| 386 | const TensorInfo& output, |
| 387 | const L2NormalizationDescriptor& descriptor, |
| 388 | Optional<std::string&> reasonIfUnsupported) const |
| 389 | { |
| 390 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClL2NormalizationWorkloadValidate, |
| 391 | reasonIfUnsupported, |
| 392 | input, |
| 393 | output, |
| 394 | descriptor); |
| 395 | } |
| 396 | |
| 397 | bool ClLayerSupport::IsLstmSupported(const TensorInfo& input, |
| 398 | const TensorInfo& outputStateIn, |
| 399 | const TensorInfo& cellStateIn, |
| 400 | const TensorInfo& scratchBuffer, |
| 401 | const TensorInfo& outputStateOut, |
| 402 | const TensorInfo& cellStateOut, |
| 403 | const TensorInfo& output, |
| 404 | const LstmDescriptor& descriptor, |
| 405 | const TensorInfo& inputToForgetWeights, |
| 406 | const TensorInfo& inputToCellWeights, |
| 407 | const TensorInfo& inputToOutputWeights, |
| 408 | const TensorInfo& recurrentToForgetWeights, |
| 409 | const TensorInfo& recurrentToCellWeights, |
| 410 | const TensorInfo& recurrentToOutputWeights, |
| 411 | const TensorInfo& forgetGateBias, |
| 412 | const TensorInfo& cellBias, |
| 413 | const TensorInfo& outputGateBias, |
| 414 | const TensorInfo* inputToInputWeights, |
| 415 | const TensorInfo* recurrentToInputWeights, |
| 416 | const TensorInfo* cellToInputWeights, |
| 417 | const TensorInfo* inputGateBias, |
| 418 | const TensorInfo* projectionWeights, |
| 419 | const TensorInfo* projectionBias, |
| 420 | const TensorInfo* cellToForgetWeights, |
| 421 | const TensorInfo* cellToOutputWeights, |
| 422 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 423 | { |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 424 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClLstmFloatWorkloadValidate, |
| 425 | reasonIfUnsupported, |
| 426 | input, |
| 427 | outputStateIn, |
| 428 | cellStateIn, |
| 429 | scratchBuffer, |
| 430 | outputStateOut, |
| 431 | cellStateOut, |
| 432 | output, |
| 433 | descriptor, |
| 434 | inputToForgetWeights, |
| 435 | inputToCellWeights, |
| 436 | inputToOutputWeights, |
| 437 | recurrentToForgetWeights, |
| 438 | recurrentToCellWeights, |
| 439 | recurrentToOutputWeights, |
| 440 | forgetGateBias, |
| 441 | cellBias, |
| 442 | outputGateBias, |
| 443 | inputToInputWeights, |
| 444 | recurrentToInputWeights, |
| 445 | cellToInputWeights, |
| 446 | inputGateBias, |
| 447 | projectionWeights, |
| 448 | projectionBias, |
| 449 | cellToForgetWeights, |
| 450 | cellToOutputWeights); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 451 | } |
| 452 | |
keidav01 | a959ee5 | 2018-12-19 10:04:58 +0000 | [diff] [blame] | 453 | bool ClLayerSupport::IsMaximumSupported(const TensorInfo& input0, |
| 454 | const TensorInfo& input1, |
| 455 | const TensorInfo& output, |
| 456 | Optional<std::string&> reasonIfUnsupported) const |
| 457 | { |
| 458 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClMaximumWorkloadValidate, |
| 459 | reasonIfUnsupported, |
| 460 | input0, |
| 461 | input1, |
| 462 | output); |
| 463 | } |
| 464 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 465 | bool ClLayerSupport::IsMeanSupported(const TensorInfo& input, |
| 466 | const TensorInfo& output, |
| 467 | const MeanDescriptor& descriptor, |
| 468 | Optional<std::string&> reasonIfUnsupported) const |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 469 | { |
Matteo Martincigh | 28dcab6 | 2018-10-19 16:40:03 +0100 | [diff] [blame] | 470 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClMeanValidate, |
| 471 | reasonIfUnsupported, |
| 472 | input, |
| 473 | output, |
| 474 | descriptor); |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 475 | } |
| 476 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 477 | bool ClLayerSupport::IsMemCopySupported(const TensorInfo &input, |
| 478 | const TensorInfo &output, |
| 479 | Optional<std::string &> reasonIfUnsupported) const |
| 480 | { |
| 481 | ignore_unused(input); |
| 482 | ignore_unused(output); |
| 483 | return true; |
| 484 | } |
| 485 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 486 | bool ClLayerSupport::IsMergerSupported(const std::vector<const TensorInfo*> inputs, |
Nikhil Raj | 8599a41 | 2018-11-19 14:51:07 +0000 | [diff] [blame] | 487 | const TensorInfo& output, |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 488 | const MergerDescriptor& descriptor, |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 489 | Optional<std::string&> reasonIfUnsupported) const |
| 490 | { |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 491 | return IsConcatSupported(inputs, output, descriptor, reasonIfUnsupported); |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 492 | } |
| 493 | |
saoste01 | 9292aa3 | 2019-01-08 13:55:59 +0000 | [diff] [blame] | 494 | bool ClLayerSupport::IsMinimumSupported(const TensorInfo& input0, |
| 495 | const TensorInfo& input1, |
| 496 | const TensorInfo& output, |
| 497 | Optional<std::string&> reasonIfUnsupported) const |
| 498 | { |
| 499 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClMinimumWorkloadValidate, |
| 500 | reasonIfUnsupported, |
| 501 | input0, |
| 502 | input1, |
| 503 | output); |
| 504 | } |
| 505 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 506 | bool ClLayerSupport::IsMultiplicationSupported(const TensorInfo& input0, |
| 507 | const TensorInfo& input1, |
| 508 | const TensorInfo& output, |
| 509 | Optional<std::string&> reasonIfUnsupported) const |
| 510 | { |
| 511 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClMultiplicationWorkloadValidate, |
| 512 | reasonIfUnsupported, |
| 513 | input0, |
| 514 | input1, |
| 515 | output); |
| 516 | } |
| 517 | |
| 518 | bool ClLayerSupport::IsNormalizationSupported(const TensorInfo& input, |
| 519 | const TensorInfo& output, |
| 520 | const NormalizationDescriptor& descriptor, |
| 521 | Optional<std::string&> reasonIfUnsupported) const |
| 522 | { |
| 523 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClNormalizationWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
| 524 | } |
| 525 | |
| 526 | bool ClLayerSupport::IsOutputSupported(const TensorInfo& output, |
| 527 | Optional<std::string&> reasonIfUnsupported) const |
| 528 | { |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 529 | return IsClBackendSupported(reasonIfUnsupported) && |
| 530 | IsSupportedForDataTypeGeneric(reasonIfUnsupported, |
| 531 | output.GetDataType(), |
| 532 | &TrueFunc<>, |
| 533 | &TrueFunc<>, |
| 534 | &TrueFunc<>, |
| 535 | &FalseFuncI32<>, |
| 536 | &TrueFunc<>); |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 537 | } |
| 538 | |
| 539 | bool ClLayerSupport::IsPadSupported(const TensorInfo& input, |
| 540 | const TensorInfo& output, |
| 541 | const PadDescriptor& descriptor, |
| 542 | Optional<std::string&> reasonIfUnsupported) const |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 543 | { |
| 544 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClPadValidate, |
| 545 | reasonIfUnsupported, |
| 546 | input, |
| 547 | output, |
| 548 | descriptor); |
| 549 | } |
| 550 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 551 | bool ClLayerSupport::IsPermuteSupported(const TensorInfo& input, |
| 552 | const TensorInfo& output, |
| 553 | const PermuteDescriptor& descriptor, |
| 554 | Optional<std::string&> reasonIfUnsupported) const |
| 555 | { |
| 556 | ignore_unused(input); |
| 557 | ignore_unused(output); |
| 558 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClPermuteWorkloadValidate, reasonIfUnsupported, descriptor); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 559 | } |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 560 | |
| 561 | bool ClLayerSupport::IsPooling2dSupported(const TensorInfo& input, |
| 562 | const TensorInfo& output, |
| 563 | const Pooling2dDescriptor& descriptor, |
| 564 | Optional<std::string&> reasonIfUnsupported) const |
| 565 | { |
| 566 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClPooling2dWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
| 567 | } |
| 568 | |
Sadik Armagan | 20ec249 | 2019-05-31 09:09:44 +0100 | [diff] [blame] | 569 | bool ClLayerSupport::IsQuantizeSupported(const TensorInfo& input, |
| 570 | const TensorInfo& output, |
| 571 | Optional<std::string&> reasonIfUnsupported) const |
| 572 | { |
| 573 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClQuantizeWorkloadValidate, |
| 574 | reasonIfUnsupported, |
| 575 | input, |
| 576 | output); |
| 577 | } |
| 578 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 579 | bool ClLayerSupport::IsReshapeSupported(const TensorInfo& input, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 580 | const ReshapeDescriptor& descriptor, |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 581 | Optional<std::string&> reasonIfUnsupported) const |
| 582 | { |
| 583 | ignore_unused(input); |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 584 | ignore_unused(descriptor); |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 585 | ignore_unused(reasonIfUnsupported); |
| 586 | return true; |
| 587 | } |
| 588 | |
| 589 | bool ClLayerSupport::IsResizeBilinearSupported(const TensorInfo& input, |
Sadik Armagan | c625f00 | 2018-12-17 11:32:16 +0000 | [diff] [blame] | 590 | const TensorInfo& output, |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 591 | Optional<std::string&> reasonIfUnsupported) const |
| 592 | { |
Sadik Armagan | c625f00 | 2018-12-17 11:32:16 +0000 | [diff] [blame] | 593 | ignore_unused(output); |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 594 | return IsSupportedForDataTypeCl(reasonIfUnsupported, |
| 595 | input.GetDataType(), |
| 596 | &TrueFunc<>, |
| 597 | &FalseFuncU8<>); |
| 598 | } |
| 599 | |
| 600 | bool ClLayerSupport::IsSoftmaxSupported(const TensorInfo& input, |
| 601 | const TensorInfo& output, |
| 602 | const SoftmaxDescriptor& descriptor, |
| 603 | Optional<std::string&> reasonIfUnsupported) const |
| 604 | { |
| 605 | ignore_unused(descriptor); |
| 606 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClSoftmaxWorkloadValidate, reasonIfUnsupported, input, output); |
| 607 | } |
| 608 | |
Sadik Armagan | f446432 | 2018-12-20 16:19:12 +0000 | [diff] [blame] | 609 | bool ClLayerSupport::IsSpaceToBatchNdSupported(const TensorInfo& input, |
| 610 | const TensorInfo& output, |
| 611 | const SpaceToBatchNdDescriptor& descriptor, |
| 612 | Optional<std::string&> reasonIfUnsupported) const |
| 613 | { |
| 614 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClSpaceToBatchNdWorkloadValidate, |
| 615 | reasonIfUnsupported, |
| 616 | input, |
| 617 | output, |
| 618 | descriptor); |
| 619 | } |
| 620 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 621 | bool ClLayerSupport::IsSplitterSupported(const TensorInfo& input, |
| 622 | const ViewsDescriptor& descriptor, |
| 623 | Optional<std::string&> reasonIfUnsupported) const |
| 624 | { |
| 625 | ignore_unused(descriptor); |
| 626 | return IsSupportedForDataTypeCl(reasonIfUnsupported, |
| 627 | input.GetDataType(), |
| 628 | &TrueFunc<>, |
| 629 | &TrueFunc<>); |
| 630 | } |
| 631 | |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 632 | bool ClLayerSupport::IsSplitterSupported(const TensorInfo& input, |
| 633 | const std::vector<std::reference_wrapper<TensorInfo>>& outputs, |
| 634 | const ViewsDescriptor& descriptor, |
| 635 | Optional<std::string&> reasonIfUnsupported) const |
| 636 | { |
Narumol Prangnawarat | 7413583 | 2019-05-23 15:07:33 +0100 | [diff] [blame] | 637 | #if defined(ARMCOMPUTECL_ENABLED) |
| 638 | // Split along the last dimension, cannot use sub-tensors |
| 639 | // as width and height of the sub-tensors do not match |
| 640 | // the width and height of the parent tensor |
| 641 | // in case of input with more than 2D. |
| 642 | std::set<unsigned int> splitAxis = ComputeSplitAxis(descriptor, input.GetShape()); |
| 643 | if (descriptor.GetNumDimensions() > 2 && splitAxis.size() == 1 && |
| 644 | *splitAxis.begin() == descriptor.GetNumDimensions() - 1 ) |
| 645 | { |
| 646 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClSplitterWorkloadValidate, |
| 647 | reasonIfUnsupported, |
| 648 | input, |
| 649 | outputs, |
| 650 | *splitAxis.begin()); |
| 651 | } |
| 652 | #endif |
| 653 | for (auto output : outputs) |
| 654 | { |
| 655 | if (!input.IsTypeSpaceMatch(output)) // Cannot use sub-tensors if the types are not same space |
| 656 | { |
| 657 | SetValueChecked(reasonIfUnsupported, "Cl Splitter: Types and quantization parameters must match."); |
| 658 | return false; |
| 659 | } |
| 660 | } |
| 661 | return true; |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 662 | } |
| 663 | |
keidav01 | d74dc91 | 2018-12-10 18:16:07 +0000 | [diff] [blame] | 664 | bool ClLayerSupport::IsStridedSliceSupported(const TensorInfo& input, |
| 665 | const TensorInfo& output, |
| 666 | const StridedSliceDescriptor& descriptor, |
| 667 | Optional<std::string&> reasonIfUnsupported) const |
| 668 | { |
| 669 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClStridedSliceWorkloadValidate, |
| 670 | reasonIfUnsupported, |
| 671 | input, |
| 672 | output, |
| 673 | descriptor); |
| 674 | } |
| 675 | |
Aron Virginas-Tar | bcf9f16 | 2018-10-15 11:47:37 +0100 | [diff] [blame] | 676 | bool ClLayerSupport::IsSubtractionSupported(const TensorInfo& input0, |
| 677 | const TensorInfo& input1, |
| 678 | const TensorInfo& output, |
| 679 | Optional<std::string&> reasonIfUnsupported) const |
| 680 | { |
| 681 | FORWARD_WORKLOAD_VALIDATE_FUNC(ClSubtractionValidate, |
| 682 | reasonIfUnsupported, |
| 683 | input0, |
| 684 | input1, |
| 685 | output); |
| 686 | } |
| 687 | |
| 688 | } // namespace armnn |