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