blob: a0f0c6b30e9617a74bac70b8e09f50b528e07445 [file] [log] [blame]
Ryan OSheaf4bfa6a2020-06-10 11:33:37 +01001//
Matthew Sloyan2d213a72022-06-30 17:13:04 +01002// Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
Ryan OSheaf4bfa6a2020-06-10 11:33:37 +01003// SPDX-License-Identifier: MIT
4//
5
6#include "RefFillWorkload.hpp"
7#include "Fill.hpp"
8
9#include "Decoders.hpp"
10#include "Encoders.hpp"
11#include "RefWorkloadUtils.hpp"
12#include "Profiling.hpp"
13
14namespace armnn
15{
16
17void RefFillWorkload::Execute() const
18{
Finn Williamsb8181f72021-04-07 10:23:21 +010019 Execute(m_Data.m_Outputs);
20}
21
Matthew Sloyan2d213a72022-06-30 17:13:04 +010022void RefFillWorkload::ExecuteAsync(ExecutionData& executionData)
Finn Williamsb8181f72021-04-07 10:23:21 +010023{
Matthew Sloyan2d213a72022-06-30 17:13:04 +010024 WorkingMemDescriptor* workingMemDescriptor = static_cast<WorkingMemDescriptor*>(executionData.m_Data);
25 Execute(workingMemDescriptor->m_Outputs);
Finn Williamsb8181f72021-04-07 10:23:21 +010026}
27
28void RefFillWorkload::Execute(std::vector<ITensorHandle*> outputs) const
29{
Ryan OSheaf4bfa6a2020-06-10 11:33:37 +010030 ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefFillWorkload_Execute");
31
Finn Williamsb8181f72021-04-07 10:23:21 +010032 const TensorInfo &outputTensorInfo = GetTensorInfo(outputs[0]);
Ryan OSheaf4bfa6a2020-06-10 11:33:37 +010033
Finn Williamsb8181f72021-04-07 10:23:21 +010034 std::unique_ptr<Encoder<float>> encoderPtr = MakeEncoder<float>(outputTensorInfo, outputs[0]->Map());
Ryan OSheaf4bfa6a2020-06-10 11:33:37 +010035 Encoder<float> &encoder = *encoderPtr;
36
37 Fill(encoder, outputTensorInfo.GetShape(), m_Data.m_Parameters.m_Value);
38}
39
40} //namespace armnn