Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "MemImportWorkload.hpp" |
| 7 | |
| 8 | #include "CpuTensorHandle.hpp" |
| 9 | |
| 10 | #include <ResolveType.hpp> |
| 11 | |
| 12 | #include <boost/cast.hpp> |
| 13 | |
| 14 | #include <cstring> |
| 15 | |
| 16 | namespace armnn |
| 17 | { |
| 18 | |
| 19 | ImportMemGenericWorkload::ImportMemGenericWorkload(const MemImportQueueDescriptor& descriptor, |
| 20 | const WorkloadInfo& info) |
| 21 | : BaseWorkload<MemImportQueueDescriptor>(descriptor, info) |
| 22 | { |
| 23 | m_TensorHandlePairs = std::make_pair(descriptor.m_Inputs[0], descriptor.m_Outputs[0]); |
| 24 | } |
| 25 | |
| 26 | void ImportMemGenericWorkload::Execute() const |
| 27 | { |
| 28 | ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "ImportMemGeneric_Execute"); |
| 29 | |
| 30 | m_TensorHandlePairs.second->Import(const_cast<void*>(m_TensorHandlePairs.first->Map(true)), MemorySource::Malloc); |
| 31 | m_TensorHandlePairs.first->Unmap(); |
| 32 | } |
| 33 | |
| 34 | } //namespace armnn |