blob: 5636a6a47cf731ffeb8aef7002ff3decbc0e223d [file] [log] [blame]
James Conroyfe3ec942020-11-18 14:20:53 +00001//
Mike Kelly7cbe7812023-07-25 17:37:33 +01002// Copyright © 2020-2023 Arm Ltd and Contributors. All rights reserved.
James Conroyfe3ec942020-11-18 14:20:53 +00003// SPDX-License-Identifier: MIT
4//
5
6#include "ClLogicalNotWorkload.hpp"
7
8#include "ClWorkloadUtils.hpp"
9
10#include <armnn/utility/PolymorphicDowncast.hpp>
11
12#include <aclCommon/ArmComputeTensorUtils.hpp>
13
14#include <cl/ClTensorHandle.hpp>
15
16namespace armnn
17{
18using namespace armcomputetensorutils;
19
20arm_compute::Status ClLogicalNotWorkloadValidate(const TensorInfo& input,
21 const TensorInfo& output)
22{
23 const arm_compute::TensorInfo aclInputInfo = BuildArmComputeTensorInfo(input);
24 const arm_compute::TensorInfo aclOutputInfo = BuildArmComputeTensorInfo(output);
25
26 const arm_compute::Status aclStatus = arm_compute::CLLogicalNot::validate(&aclInputInfo,
27 &aclOutputInfo);
28 return aclStatus;
29}
30
31ClLogicalNotWorkload::ClLogicalNotWorkload(const ElementwiseUnaryQueueDescriptor& descriptor,
Sadik Armagane9444752020-12-02 11:28:58 +000032 const WorkloadInfo& info,
33 const arm_compute::CLCompileContext& clCompileContext)
Teresa Charlin588cbdf2022-01-19 15:55:37 +000034 : ClBaseWorkload<ElementwiseUnaryQueueDescriptor>(descriptor, info)
James Conroyfe3ec942020-11-18 14:20:53 +000035{
Keith Davisbcd860a2021-08-05 14:20:33 +010036 // Report Profiling Details
37 ARMNN_REPORT_PROFILING_WORKLOAD_DESC("ClLogicalNotWorkload_Construct",
38 descriptor.m_Parameters,
39 info,
40 this->GetGuid());
41
James Conroyfe3ec942020-11-18 14:20:53 +000042 m_Data.ValidateInputsOutputs("ClLogicalNotWorkload", 1, 1);
43
44 arm_compute::ICLTensor& input = PolymorphicDowncast<ClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
45 arm_compute::ICLTensor& output = PolymorphicDowncast<ClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
46
Kevin May9f6862d2021-10-22 15:42:28 +010047 {
Mike Kelly7cbe7812023-07-25 17:37:33 +010048 ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClLogicalNotWorkload_configure");
Kevin May9f6862d2021-10-22 15:42:28 +010049 m_LogicalNotLayer.configure(clCompileContext, &input, &output);
50 }
James Conroyfe3ec942020-11-18 14:20:53 +000051}
52
53void ClLogicalNotWorkload::Execute() const
54{
Mike Kelly7cbe7812023-07-25 17:37:33 +010055 ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClLogicalNotWorkload_Execute");
James Conroyfe3ec942020-11-18 14:20:53 +000056 m_LogicalNotLayer.run();
57}
58
59} // namespace armnn