blob: a2204fa42d164befbf71d1d34da592d17c727ef8 [file] [log] [blame]
Sadik Armagan66aecb02020-06-24 11:42:20 +01001//
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
14namespace armnn
15{
16using namespace armcomputetensorutils;
17
Sadik Armagane9444752020-12-02 11:28:58 +000018ClFillWorkload::ClFillWorkload(const FillQueueDescriptor& descriptor,
19 const WorkloadInfo& info,
20 const arm_compute::CLCompileContext& clCompileContext)
Sadik Armagan66aecb02020-06-24 11:42:20 +010021 : BaseWorkload<FillQueueDescriptor>(descriptor, info)
22{
23 m_Data.ValidateInputsOutputs("ClFillWorkload", 1, 1);
24
25 arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(this->m_Data.m_Outputs[0])->GetTensor();
26 arm_compute::PixelValue pixelValue = GetPixelValue(output, descriptor.m_Parameters.m_Value);
27
Sadik Armagane9444752020-12-02 11:28:58 +000028 m_Layer.configure(clCompileContext, &output, pixelValue);
Sadik Armagan66aecb02020-06-24 11:42:20 +010029}
30
31void ClFillWorkload::Execute() const
32{
33 ARMNN_SCOPED_PROFILING_EVENT_CL("ClFillWorkload_Execute");
34 RunClFunction(m_Layer, CHECK_LOCATION());
35}
36
37} // namespace armnn