blob: 14c6d5cc61378003df2cb3779b4e9ab2f1f744bd [file] [log] [blame]
telsoa014fcda012018-03-09 14:13:49 +00001//
Sadik Armagana097d2a2021-11-24 15:47:28 +00002// Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa014fcda012018-03-09 14:13:49 +00004//
5
Sadik Armagana097d2a2021-11-24 15:47:28 +00006#include <armnnTestUtils/TensorCopyUtils.hpp>
Aron Virginas-Tarc9cc8042018-11-01 16:15:57 +00007#include <Half.hpp>
arovir01616e7752018-10-01 17:08:59 +01008
David Beck09e2f272018-10-30 11:38:41 +00009void CopyDataToITensorHandle(armnn::ITensorHandle* tensorHandle, const void* memory)
telsoa014fcda012018-03-09 14:13:49 +000010{
David Beck09e2f272018-10-30 11:38:41 +000011 tensorHandle->CopyInFrom(memory);
telsoa014fcda012018-03-09 14:13:49 +000012}
13
David Beck09e2f272018-10-30 11:38:41 +000014void CopyDataFromITensorHandle(void* memory, const armnn::ITensorHandle* tensorHandle)
telsoa014fcda012018-03-09 14:13:49 +000015{
David Beck09e2f272018-10-30 11:38:41 +000016 tensorHandle->CopyOutTo(memory);
telsoa014fcda012018-03-09 14:13:49 +000017}
18
David Beck09e2f272018-10-30 11:38:41 +000019void AllocateAndCopyDataToITensorHandle(armnn::ITensorHandle* tensorHandle, const void* memory)
telsoa014fcda012018-03-09 14:13:49 +000020{
21 tensorHandle->Allocate();
David Beck09e2f272018-10-30 11:38:41 +000022 CopyDataToITensorHandle(tensorHandle, memory);
telsoa014fcda012018-03-09 14:13:49 +000023}