Ryan OShea | f4bfa6a | 2020-06-10 11:33:37 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. |
| 3 | // 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 | |
| 14 | namespace armnn |
| 15 | { |
| 16 | |
| 17 | void RefFillWorkload::Execute() const |
| 18 | { |
Finn Williams | b8181f7 | 2021-04-07 10:23:21 +0100 | [diff] [blame] | 19 | Execute(m_Data.m_Outputs); |
| 20 | } |
| 21 | |
| 22 | void RefFillWorkload::ExecuteAsync(WorkingMemDescriptor &workingMemDescriptor) |
| 23 | { |
| 24 | Execute(workingMemDescriptor.m_Outputs); |
| 25 | } |
| 26 | |
| 27 | void RefFillWorkload::Execute(std::vector<ITensorHandle*> outputs) const |
| 28 | { |
Ryan OShea | f4bfa6a | 2020-06-10 11:33:37 +0100 | [diff] [blame] | 29 | ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefFillWorkload_Execute"); |
| 30 | |
Finn Williams | b8181f7 | 2021-04-07 10:23:21 +0100 | [diff] [blame] | 31 | const TensorInfo &outputTensorInfo = GetTensorInfo(outputs[0]); |
Ryan OShea | f4bfa6a | 2020-06-10 11:33:37 +0100 | [diff] [blame] | 32 | |
Finn Williams | b8181f7 | 2021-04-07 10:23:21 +0100 | [diff] [blame] | 33 | std::unique_ptr<Encoder<float>> encoderPtr = MakeEncoder<float>(outputTensorInfo, outputs[0]->Map()); |
Ryan OShea | f4bfa6a | 2020-06-10 11:33:37 +0100 | [diff] [blame] | 34 | Encoder<float> &encoder = *encoderPtr; |
| 35 | |
| 36 | Fill(encoder, outputTensorInfo.GetShape(), m_Data.m_Parameters.m_Value); |
| 37 | } |
| 38 | |
| 39 | } //namespace armnn |