James Conroy | fe3ec94 | 2020-11-18 14:20:53 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. |
| 3 | // 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 | |
| 16 | namespace armnn |
| 17 | { |
| 18 | using namespace armcomputetensorutils; |
| 19 | |
| 20 | arm_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 | |
| 31 | ClLogicalNotWorkload::ClLogicalNotWorkload(const ElementwiseUnaryQueueDescriptor& descriptor, |
Sadik Armagan | e944475 | 2020-12-02 11:28:58 +0000 | [diff] [blame] | 32 | const WorkloadInfo& info, |
| 33 | const arm_compute::CLCompileContext& clCompileContext) |
Teresa Charlin | 588cbdf | 2022-01-19 15:55:37 +0000 | [diff] [blame] | 34 | : ClBaseWorkload<ElementwiseUnaryQueueDescriptor>(descriptor, info) |
James Conroy | fe3ec94 | 2020-11-18 14:20:53 +0000 | [diff] [blame] | 35 | { |
Keith Davis | bcd860a | 2021-08-05 14:20:33 +0100 | [diff] [blame] | 36 | // Report Profiling Details |
| 37 | ARMNN_REPORT_PROFILING_WORKLOAD_DESC("ClLogicalNotWorkload_Construct", |
| 38 | descriptor.m_Parameters, |
| 39 | info, |
| 40 | this->GetGuid()); |
| 41 | |
James Conroy | fe3ec94 | 2020-11-18 14:20:53 +0000 | [diff] [blame] | 42 | 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 May | 9f6862d | 2021-10-22 15:42:28 +0100 | [diff] [blame] | 47 | { |
| 48 | ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "ClLogicalNotWorkload_configure"); |
| 49 | m_LogicalNotLayer.configure(clCompileContext, &input, &output); |
| 50 | } |
James Conroy | fe3ec94 | 2020-11-18 14:20:53 +0000 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | void ClLogicalNotWorkload::Execute() const |
| 54 | { |
Keith Davis | bcd860a | 2021-08-05 14:20:33 +0100 | [diff] [blame] | 55 | ARMNN_SCOPED_PROFILING_EVENT_CL_GUID("ClLogicalNotWorkload_Execute", this->GetGuid()); |
James Conroy | fe3ec94 | 2020-11-18 14:20:53 +0000 | [diff] [blame] | 56 | m_LogicalNotLayer.run(); |
| 57 | } |
| 58 | |
| 59 | } // namespace armnn |