aboutsummaryrefslogtreecommitdiff
path: root/src/armnnTestUtils/TensorCopyUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/armnnTestUtils/TensorCopyUtils.cpp')
-rw-r--r--src/armnnTestUtils/TensorCopyUtils.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/armnnTestUtils/TensorCopyUtils.cpp b/src/armnnTestUtils/TensorCopyUtils.cpp
new file mode 100644
index 0000000000..14c6d5cc61
--- /dev/null
+++ b/src/armnnTestUtils/TensorCopyUtils.cpp
@@ -0,0 +1,23 @@
+//
+// Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#include <armnnTestUtils/TensorCopyUtils.hpp>
+#include <Half.hpp>
+
+void CopyDataToITensorHandle(armnn::ITensorHandle* tensorHandle, const void* memory)
+{
+ tensorHandle->CopyInFrom(memory);
+}
+
+void CopyDataFromITensorHandle(void* memory, const armnn::ITensorHandle* tensorHandle)
+{
+ tensorHandle->CopyOutTo(memory);
+}
+
+void AllocateAndCopyDataToITensorHandle(armnn::ITensorHandle* tensorHandle, const void* memory)
+{
+ tensorHandle->Allocate();
+ CopyDataToITensorHandle(tensorHandle, memory);
+}