Release 18.08
[platform/upstream/armnn.git] / src / armnn / backends / ClWorkloads / ClSoftmaxBaseWorkload.cpp
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
4 //
5
6 #include "ClSoftmaxBaseWorkload.hpp"
7
8 #include "backends/ArmComputeTensorUtils.hpp"
9
10 namespace armnn
11 {
12
13 arm_compute::Status ClSoftmaxWorkloadValidate(const TensorInfo& input,
14                                               const TensorInfo& output)
15 {
16     // NOTE: We report 4D Softmax as unsupported until full support is added to ACL
17     if(input.GetShape().GetNumDimensions() >= 4u)
18     {
19         return arm_compute::Status(arm_compute::ErrorCode::RUNTIME_ERROR, "4d softmax is not supported");
20     }
21
22     const arm_compute::TensorInfo aclInputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(input);
23     const arm_compute::TensorInfo aclOutputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(output);
24
25     return arm_compute::CLSoftmaxLayer::validate(&aclInputInfo, &aclOutputInfo);
26 }
27
28 }