Sadik Armagan | 66aecb0 | 2020-06-24 11:42:20 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "ClFillWorkload.hpp" |
| 7 | |
| 8 | #include "ClWorkloadUtils.hpp" |
| 9 | |
| 10 | #include <cl/ClTensorHandle.hpp> |
| 11 | #include <aclCommon/ArmComputeTensorUtils.hpp> |
| 12 | #include <arm_compute/core/Types.h> |
| 13 | |
| 14 | namespace armnn |
| 15 | { |
| 16 | using namespace armcomputetensorutils; |
| 17 | |
Sadik Armagan | e944475 | 2020-12-02 11:28:58 +0000 | [diff] [blame] | 18 | ClFillWorkload::ClFillWorkload(const FillQueueDescriptor& descriptor, |
| 19 | const WorkloadInfo& info, |
| 20 | const arm_compute::CLCompileContext& clCompileContext) |
Sadik Armagan | 66aecb0 | 2020-06-24 11:42:20 +0100 | [diff] [blame] | 21 | : BaseWorkload<FillQueueDescriptor>(descriptor, info) |
| 22 | { |
Keith Davis | bcd860a | 2021-08-05 14:20:33 +0100 | [diff] [blame] | 23 | // Report Profiling Details |
| 24 | ARMNN_REPORT_PROFILING_WORKLOAD_DESC("ClFillWorkload_Construct", |
| 25 | descriptor.m_Parameters, |
| 26 | info, |
| 27 | this->GetGuid()); |
| 28 | |
Sadik Armagan | 66aecb0 | 2020-06-24 11:42:20 +0100 | [diff] [blame] | 29 | m_Data.ValidateInputsOutputs("ClFillWorkload", 1, 1); |
| 30 | |
| 31 | arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(this->m_Data.m_Outputs[0])->GetTensor(); |
| 32 | arm_compute::PixelValue pixelValue = GetPixelValue(output, descriptor.m_Parameters.m_Value); |
| 33 | |
Sadik Armagan | e944475 | 2020-12-02 11:28:58 +0000 | [diff] [blame] | 34 | m_Layer.configure(clCompileContext, &output, pixelValue); |
Sadik Armagan | 66aecb0 | 2020-06-24 11:42:20 +0100 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | void ClFillWorkload::Execute() const |
| 38 | { |
Keith Davis | bcd860a | 2021-08-05 14:20:33 +0100 | [diff] [blame] | 39 | ARMNN_SCOPED_PROFILING_EVENT_CL_GUID("ClFillWorkload_Execute", this->GetGuid()); |
Sadik Armagan | 66aecb0 | 2020-06-24 11:42:20 +0100 | [diff] [blame] | 40 | RunClFunction(m_Layer, CHECK_LOCATION()); |
| 41 | } |
| 42 | |
| 43 | } // namespace armnn |