aboutsummaryrefslogtreecommitdiff
path: root/src/backends/ClWorkloads/ClSoftmaxBaseWorkload.cpp
blob: b4ea236d49a031c9b88d9c15e836637786d0a8f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include "ClSoftmaxBaseWorkload.hpp"

#include "backends/ArmComputeTensorUtils.hpp"

#include <arm_compute/runtime/CL/functions/CLSoftmaxLayer.h>

namespace armnn
{

arm_compute::Status ClSoftmaxWorkloadValidate(const TensorInfo& input,
                                              const TensorInfo& output)
{
    // NOTE: We report 4D Softmax as unsupported until full support is added to ACL
    if(input.GetShape().GetNumDimensions() >= 4u)
    {
        return arm_compute::Status(arm_compute::ErrorCode::RUNTIME_ERROR, "4d softmax is not supported");
    }

    const arm_compute::TensorInfo aclInputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(input);
    const arm_compute::TensorInfo aclOutputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(output);

    return arm_compute::CLSoftmaxLayer::validate(&aclInputInfo, &aclOutputInfo);
}

}