narpra01 | db2b160 | 2019-01-23 15:23:11 +0000 | [diff] [blame] | 1 | // |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 4 | // |
| 5 | |
narpra01 | db2b160 | 2019-01-23 15:23:11 +0000 | [diff] [blame] | 6 | #include "RefConstantWorkload.hpp" |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 7 | |
| 8 | #include "RefWorkloadUtils.hpp" |
| 9 | |
| 10 | #include <armnn/Types.hpp> |
| 11 | |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 12 | #include <armnn/utility/Assert.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 13 | |
| 14 | #include <cstring> |
| 15 | |
| 16 | namespace armnn |
| 17 | { |
| 18 | |
Nina Drozd | 58ef2c6 | 2019-05-16 12:09:18 +0100 | [diff] [blame] | 19 | RefConstantWorkload::RefConstantWorkload( |
| 20 | const ConstantQueueDescriptor& descriptor, const WorkloadInfo& info) |
| 21 | : BaseWorkload<ConstantQueueDescriptor>(descriptor, info) {} |
| 22 | |
| 23 | void RefConstantWorkload::PostAllocationConfigure() |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 24 | { |
Nina Drozd | 58ef2c6 | 2019-05-16 12:09:18 +0100 | [diff] [blame] | 25 | const ConstantQueueDescriptor& data = this->m_Data; |
narpra01 | db2b160 | 2019-01-23 15:23:11 +0000 | [diff] [blame] | 26 | |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 27 | ARMNN_ASSERT(data.m_LayerOutput != nullptr); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 28 | |
Nina Drozd | 58ef2c6 | 2019-05-16 12:09:18 +0100 | [diff] [blame] | 29 | const TensorInfo& outputInfo = GetTensorInfo(data.m_Outputs[0]); |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 30 | ARMNN_ASSERT(data.m_LayerOutput->GetTensorInfo().GetNumBytes() == outputInfo.GetNumBytes()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 31 | |
Nina Drozd | 58ef2c6 | 2019-05-16 12:09:18 +0100 | [diff] [blame] | 32 | memcpy(GetOutputTensorData<void>(0, data), data.m_LayerOutput->GetConstTensor<void>(), |
| 33 | outputInfo.GetNumBytes()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 34 | } |
| 35 | |
Nina Drozd | 58ef2c6 | 2019-05-16 12:09:18 +0100 | [diff] [blame] | 36 | void RefConstantWorkload::Execute() const |
| 37 | { |
| 38 | ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefConstantWorkload_Execute"); |
| 39 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 40 | |
| 41 | } //namespace armnn |