Sadik Armagan | a792a05 | 2020-06-23 16:22:23 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "NeonFillWorkload.hpp" |
| 7 | |
| 8 | #include <neon/NeonTensorHandle.hpp> |
| 9 | #include <aclCommon/ArmComputeTensorUtils.hpp> |
| 10 | #include <arm_compute/core/Types.h> |
| 11 | #include <arm_compute/runtime/NEON/functions/NEFill.h> |
| 12 | |
| 13 | #include "NeonWorkloadUtils.hpp" |
| 14 | |
| 15 | namespace armnn |
| 16 | { |
| 17 | using namespace armcomputetensorutils; |
| 18 | |
| 19 | NeonFillWorkload::NeonFillWorkload(const FillQueueDescriptor& descriptor, const WorkloadInfo& info) |
| 20 | : BaseWorkload<FillQueueDescriptor>(descriptor, info) |
| 21 | { |
Keith Davis | 2d0679f | 2021-08-05 11:35:00 +0100 | [diff] [blame] | 22 | // Report Profiling Details |
| 23 | ARMNN_REPORT_PROFILING_WORKLOAD_DESC("NeonFillWorkload_Construct", |
| 24 | descriptor.m_Parameters, |
| 25 | info, |
| 26 | this->GetGuid()); |
| 27 | |
Sadik Armagan | a792a05 | 2020-06-23 16:22:23 +0100 | [diff] [blame] | 28 | m_Data.ValidateInputsOutputs("NeonFillWorkload", 1, 1); |
| 29 | |
| 30 | arm_compute::ITensor& output = static_cast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor(); |
| 31 | arm_compute::PixelValue pixelValue = GetPixelValue(output, descriptor.m_Parameters.m_Value); |
| 32 | |
| 33 | auto layer = std::make_unique<arm_compute::NEFill>(); |
| 34 | layer->configure(&output, pixelValue); |
| 35 | m_Layer.reset(layer.release()); |
| 36 | } |
| 37 | |
| 38 | void NeonFillWorkload::Execute() const |
| 39 | { |
Keith Davis | 2d0679f | 2021-08-05 11:35:00 +0100 | [diff] [blame] | 40 | ARMNN_SCOPED_PROFILING_EVENT_NEON_GUID("NeonFillWorkload_Execute", this->GetGuid()); |
Sadik Armagan | a792a05 | 2020-06-23 16:22:23 +0100 | [diff] [blame] | 41 | m_Layer->run(); |
| 42 | } |
| 43 | |
| 44 | } // namespace armnn |