telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [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 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 4 | // |
| 5 | |
| 6 | #include "ClSoftmaxBaseWorkload.hpp" |
| 7 | |
David Beck | 711fa31 | 2018-09-24 10:46:38 +0100 | [diff] [blame] | 8 | #include <backends/aclCommon/ArmComputeTensorUtils.hpp> |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 9 | |
Matthew Bentham | 14e4669 | 2018-09-20 15:35:30 +0100 | [diff] [blame] | 10 | #include <arm_compute/runtime/CL/functions/CLSoftmaxLayer.h> |
| 11 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 12 | namespace armnn |
| 13 | { |
| 14 | |
| 15 | arm_compute::Status ClSoftmaxWorkloadValidate(const TensorInfo& input, |
| 16 | const TensorInfo& output) |
| 17 | { |
| 18 | // NOTE: We report 4D Softmax as unsupported until full support is added to ACL |
| 19 | if(input.GetShape().GetNumDimensions() >= 4u) |
| 20 | { |
| 21 | return arm_compute::Status(arm_compute::ErrorCode::RUNTIME_ERROR, "4d softmax is not supported"); |
| 22 | } |
| 23 | |
| 24 | const arm_compute::TensorInfo aclInputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(input); |
| 25 | const arm_compute::TensorInfo aclOutputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(output); |
| 26 | |
| 27 | return arm_compute::CLSoftmaxLayer::validate(&aclInputInfo, &aclOutputInfo); |
| 28 | } |
| 29 | |
| 30 | } |