aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/NEON/UNIT
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-04-23 16:26:46 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:50:15 +0000
commit99d40951df87790fb884ce1c42d5e2a7a0009ee0 (patch)
tree774e2c6d0849a7fb3f13c7cc4773f7cbfea448fb /tests/validation/NEON/UNIT
parentcda0c38373b2f114509392ba16ef04e8c1e0f819 (diff)
downloadComputeLibrary-99d40951df87790fb884ce1c42d5e2a7a0009ee0.tar.gz
COMPMID-1023: Import memory for OpenCL
Change-Id: I201bc00a1261814737e6b6878ecfe9904bae0cc1 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/128212 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/validation/NEON/UNIT')
-rw-r--r--tests/validation/NEON/UNIT/TensorAllocator.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/validation/NEON/UNIT/TensorAllocator.cpp b/tests/validation/NEON/UNIT/TensorAllocator.cpp
index 4732f3f088..872054f3d1 100644
--- a/tests/validation/NEON/UNIT/TensorAllocator.cpp
+++ b/tests/validation/NEON/UNIT/TensorAllocator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -24,6 +24,7 @@
#include "arm_compute/runtime/TensorAllocator.h"
#include "arm_compute/runtime/MemoryGroup.h"
+#include "arm_compute/runtime/MemoryRegion.h"
#include "support/ToolchainSupport.h"
#include "tests/Utils.h"
#include "tests/framework/Asserts.h"
@@ -45,10 +46,7 @@ TEST_CASE(ImportMemory, framework::DatasetMode::ALL)
TensorInfo info(TensorShape(24U, 16U, 3U), 1, DataType::F32);
// Allocate memory buffer
- std::shared_ptr<uint8_t> buf(new uint8_t[info.total_size()](), [](uint8_t *ptr)
- {
- delete[] ptr;
- });
+ auto buf = std::make_shared<MemoryRegion>(info.total_size());
// Negative case : Import empty memory
Tensor t1;
@@ -68,7 +66,7 @@ TEST_CASE(ImportMemory, framework::DatasetMode::ALL)
t3.allocator()->init(info);
ARM_COMPUTE_EXPECT(bool(t3.allocator()->import_memory(Memory(buf.get()))), framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(!t3.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(t3.buffer() == buf.get(), framework::LogLevel::ERRORS);
+ ARM_COMPUTE_EXPECT(t3.buffer() == reinterpret_cast<uint8_t *>(buf->buffer()), framework::LogLevel::ERRORS);
t3.allocator()->free();
ARM_COMPUTE_EXPECT(t3.info()->is_resizable(), framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(t3.buffer() == nullptr, framework::LogLevel::ERRORS);
@@ -78,7 +76,7 @@ TEST_CASE(ImportMemory, framework::DatasetMode::ALL)
t4.allocator()->init(info);
ARM_COMPUTE_EXPECT(bool(t4.allocator()->import_memory(Memory(buf))), framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(!t4.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(t4.buffer() == buf.get(), framework::LogLevel::ERRORS);
+ ARM_COMPUTE_EXPECT(t4.buffer() == reinterpret_cast<uint8_t *>(buf->buffer()), framework::LogLevel::ERRORS);
t4.allocator()->free();
ARM_COMPUTE_EXPECT(t4.info()->is_resizable(), framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(t4.buffer() == nullptr, framework::LogLevel::ERRORS);