blob: ba7208cc4021d34bab2210880d1893a19224a59a [file] [log] [blame]
telsoa014fcda012018-03-09 14:13:49 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa014fcda012018-03-09 14:13:49 +00004//
5
telsoa014fcda012018-03-09 14:13:49 +00006#include "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}