Derek Lamberti | c77874a | 2020-04-28 13:34:56 +0100 | [diff] [blame] | 1 | // |
Teresa Charlin | 588cbdf | 2022-01-19 15:55:37 +0000 | [diff] [blame] | 2 | // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. |
Derek Lamberti | c77874a | 2020-04-28 13:34:56 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "NeonExpWorkload.hpp" |
| 7 | |
| 8 | #include "NeonWorkloadUtils.hpp" |
| 9 | |
| 10 | #include <aclCommon/ArmComputeTensorHandle.hpp> |
| 11 | #include <aclCommon/ArmComputeTensorUtils.hpp> |
| 12 | #include <armnn/utility/PolymorphicDowncast.hpp> |
| 13 | |
| 14 | namespace armnn |
| 15 | { |
| 16 | |
| 17 | arm_compute::Status NeonExpWorkloadValidate(const TensorInfo& input, const TensorInfo& output) |
| 18 | { |
| 19 | const arm_compute::TensorInfo aclInput = armcomputetensorutils::BuildArmComputeTensorInfo(input); |
| 20 | const arm_compute::TensorInfo aclOutput = armcomputetensorutils::BuildArmComputeTensorInfo(output); |
| 21 | |
| 22 | return arm_compute::NEExpLayer::validate(&aclInput, &aclOutput); |
| 23 | } |
| 24 | |
| 25 | NeonExpWorkload::NeonExpWorkload(const ElementwiseUnaryQueueDescriptor& descriptor, const WorkloadInfo& info) |
Teresa Charlin | 588cbdf | 2022-01-19 15:55:37 +0000 | [diff] [blame] | 26 | : NeonBaseWorkload<ElementwiseUnaryQueueDescriptor>(descriptor, info) |
Derek Lamberti | c77874a | 2020-04-28 13:34:56 +0100 | [diff] [blame] | 27 | { |
Keith Davis | 2d0679f | 2021-08-05 11:35:00 +0100 | [diff] [blame] | 28 | // Report Profiling Details |
| 29 | ARMNN_REPORT_PROFILING_WORKLOAD_DESC("NeonExpWorkload_Construct", |
| 30 | descriptor.m_Parameters, |
| 31 | info, |
| 32 | this->GetGuid()); |
| 33 | |
Derek Lamberti | c77874a | 2020-04-28 13:34:56 +0100 | [diff] [blame] | 34 | m_Data.ValidateInputsOutputs("NeonExpWorkload", 1, 1); |
| 35 | |
| 36 | arm_compute::ITensor& input = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor(); |
| 37 | arm_compute::ITensor& output = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor(); |
| 38 | |
| 39 | m_ExpLayer.configure(&input, &output); |
| 40 | } |
| 41 | |
| 42 | void NeonExpWorkload::Execute() const |
| 43 | { |
Keith Davis | 2d0679f | 2021-08-05 11:35:00 +0100 | [diff] [blame] | 44 | ARMNN_SCOPED_PROFILING_EVENT_NEON_GUID("NeonExpWorkload_Execute", this->GetGuid()); |
Derek Lamberti | c77874a | 2020-04-28 13:34:56 +0100 | [diff] [blame] | 45 | m_ExpLayer.run(); |
| 46 | } |
| 47 | |
| 48 | } // namespace armnn |