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) |
James Conroy | fe3ec94 | 2020-11-18 14:20:53 +0000 | [diff] [blame] | 34 | : BaseWorkload<ElementwiseUnaryQueueDescriptor>(descriptor, info) |
| 35 | { |
| 36 | m_Data.ValidateInputsOutputs("ClLogicalNotWorkload", 1, 1); |
| 37 | |
| 38 | arm_compute::ICLTensor& input = PolymorphicDowncast<ClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor(); |
| 39 | arm_compute::ICLTensor& output = PolymorphicDowncast<ClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor(); |
| 40 | |
Sadik Armagan | e944475 | 2020-12-02 11:28:58 +0000 | [diff] [blame] | 41 | m_LogicalNotLayer.configure(clCompileContext, &input, &output); |
James Conroy | fe3ec94 | 2020-11-18 14:20:53 +0000 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | void ClLogicalNotWorkload::Execute() const |
| 45 | { |
| 46 | ARMNN_SCOPED_PROFILING_EVENT_CL("ClLogicalNotWorkload_Execute"); |
| 47 | m_LogicalNotLayer.run(); |
| 48 | } |
| 49 | |
| 50 | } // namespace armnn |