ArmNN
 24.08
TensorCopyUtils.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017,2022 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 #include <armnnTestUtils/TensorCopyUtils.hpp>
8 #include <Half.hpp>
9 
10 void CopyDataToITensorHandle(armnn::ITensorHandle* tensorHandle, const void* memory)
11 {
12  tensorHandle->CopyInFrom(memory);
13 }
14 
15 void CopyDataFromITensorHandle(void* memory, const armnn::ITensorHandle* tensorHandle)
16 {
17  tensorHandle->CopyOutTo(memory);
18 }
19 
20 void AllocateAndCopyDataToITensorHandle(armnn::ITensorHandle* tensorHandle, const void* memory)
21 {
22  tensorHandle->Allocate();
23  CopyDataToITensorHandle(tensorHandle, memory);
24 }
armnn::ITensorHandle
Definition: ITensorHandle.hpp:16
AllocateAndCopyDataToITensorHandle
void AllocateAndCopyDataToITensorHandle(armnn::ITensorHandle *tensorHandle, const void *memory)
Definition: TensorCopyUtils.cpp:20
ITensorHandle.hpp
CopyDataFromITensorHandle
void CopyDataFromITensorHandle(void *memory, const armnn::ITensorHandle *tensorHandle)
Definition: TensorCopyUtils.cpp:15
armnn::ITensorHandle::CopyInFrom
virtual void CopyInFrom(const void *memory)=0
Half.hpp
CopyDataToITensorHandle
void CopyDataToITensorHandle(armnn::ITensorHandle *tensorHandle, const void *memory)
Definition: TensorCopyUtils.cpp:10
armnn::ITensorHandle::CopyOutTo
virtual void CopyOutTo(void *memory) const =0
Testing support to be able to verify and set tensor data content.
armnn::ITensorHandle::Allocate
virtual void Allocate()=0
Indicate to the memory manager that this resource is no longer active.