blob: bc42482527ab11247509356771377327b570ce11 [file] [log] [blame]
Sadik Armagana792a052020-06-23 16:22:23 +01001//
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
15namespace armnn
16{
17using namespace armcomputetensorutils;
18
19NeonFillWorkload::NeonFillWorkload(const FillQueueDescriptor& descriptor, const WorkloadInfo& info)
Teresa Charlin588cbdf2022-01-19 15:55:37 +000020 : NeonBaseWorkload<FillQueueDescriptor>(descriptor, info)
Sadik Armagana792a052020-06-23 16:22:23 +010021{
Keith Davis2d0679f2021-08-05 11:35:00 +010022 // Report Profiling Details
23 ARMNN_REPORT_PROFILING_WORKLOAD_DESC("NeonFillWorkload_Construct",
24 descriptor.m_Parameters,
25 info,
26 this->GetGuid());
27
Sadik Armagana792a052020-06-23 16:22:23 +010028 m_Data.ValidateInputsOutputs("NeonFillWorkload", 1, 1);
29
30 arm_compute::ITensor& output = static_cast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
Matthew Sloyan2e5d0b22021-10-21 14:05:31 +010031 arm_compute::PixelValue pixelValue = GetPixelValue(output.info(), descriptor.m_Parameters.m_Value);
Sadik Armagana792a052020-06-23 16:22:23 +010032
33 auto layer = std::make_unique<arm_compute::NEFill>();
34 layer->configure(&output, pixelValue);
35 m_Layer.reset(layer.release());
36}
37
38void NeonFillWorkload::Execute() const
39{
Keith Davis2d0679f2021-08-05 11:35:00 +010040 ARMNN_SCOPED_PROFILING_EVENT_NEON_GUID("NeonFillWorkload_Execute", this->GetGuid());
Sadik Armagana792a052020-06-23 16:22:23 +010041 m_Layer->run();
42}
43
44} // namespace armnn