telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1 | // |
Sadik Armagan | a097d2a | 2021-11-24 15:47:28 +0000 | [diff] [blame] | 2 | // Copyright © 2017 Arm Ltd and Contributors. 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 | |||||
Sadik Armagan | a097d2a | 2021-11-24 15:47:28 +0000 | [diff] [blame] | 6 | #include <armnnTestUtils/TensorCopyUtils.hpp> |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 7 | #include <Half.hpp> |
arovir01 | 616e775 | 2018-10-01 17:08:59 +0100 | [diff] [blame] | 8 | |
David Beck | 09e2f27 | 2018-10-30 11:38:41 +0000 | [diff] [blame] | 9 | void CopyDataToITensorHandle(armnn::ITensorHandle* tensorHandle, const void* memory) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 10 | { |
David Beck | 09e2f27 | 2018-10-30 11:38:41 +0000 | [diff] [blame] | 11 | tensorHandle->CopyInFrom(memory); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 12 | } |
13 | |||||
David Beck | 09e2f27 | 2018-10-30 11:38:41 +0000 | [diff] [blame] | 14 | void CopyDataFromITensorHandle(void* memory, const armnn::ITensorHandle* tensorHandle) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 15 | { |
David Beck | 09e2f27 | 2018-10-30 11:38:41 +0000 | [diff] [blame] | 16 | tensorHandle->CopyOutTo(memory); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 17 | } |
18 | |||||
David Beck | 09e2f27 | 2018-10-30 11:38:41 +0000 | [diff] [blame] | 19 | void AllocateAndCopyDataToITensorHandle(armnn::ITensorHandle* tensorHandle, const void* memory) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 20 | { |
21 | tensorHandle->Allocate(); | ||||
David Beck | 09e2f27 | 2018-10-30 11:38:41 +0000 | [diff] [blame] | 22 | CopyDataToITensorHandle(tensorHandle, memory); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 23 | } |