Sadik Armagan | 66aecb0 | 2020-06-24 11:42:20 +0100 | [diff] [blame] | 1 | // |
Mike Kelly | 7cbe781 | 2023-07-25 17:37:33 +0100 | [diff] [blame^] | 2 | // Copyright © 2020-2023 Arm Ltd and Contributors. All rights reserved. |
Sadik Armagan | 66aecb0 | 2020-06-24 11:42:20 +0100 | [diff] [blame] | 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) |
Teresa Charlin | 588cbdf | 2022-01-19 15:55:37 +0000 | [diff] [blame] | 21 | : ClBaseWorkload<FillQueueDescriptor>(descriptor, info) |
Sadik Armagan | 66aecb0 | 2020-06-24 11:42:20 +0100 | [diff] [blame] | 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(); |
Matthew Sloyan | 2e5d0b2 | 2021-10-21 14:05:31 +0100 | [diff] [blame] | 32 | arm_compute::PixelValue pixelValue = GetPixelValue(output.info(), descriptor.m_Parameters.m_Value); |
Sadik Armagan | 66aecb0 | 2020-06-24 11:42:20 +0100 | [diff] [blame] | 33 | |
Kevin May | 9f6862d | 2021-10-22 15:42:28 +0100 | [diff] [blame] | 34 | { |
Mike Kelly | 7cbe781 | 2023-07-25 17:37:33 +0100 | [diff] [blame^] | 35 | ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClFillWorkload_configure"); |
Kevin May | 9f6862d | 2021-10-22 15:42:28 +0100 | [diff] [blame] | 36 | m_Layer.configure(clCompileContext, &output, pixelValue); |
| 37 | } |
Sadik Armagan | 66aecb0 | 2020-06-24 11:42:20 +0100 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | void ClFillWorkload::Execute() const |
| 41 | { |
Mike Kelly | 7cbe781 | 2023-07-25 17:37:33 +0100 | [diff] [blame^] | 42 | ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClFillWorkload_Execute"); |
Sadik Armagan | 66aecb0 | 2020-06-24 11:42:20 +0100 | [diff] [blame] | 43 | RunClFunction(m_Layer, CHECK_LOCATION()); |
| 44 | } |
| 45 | |
| 46 | } // namespace armnn |