From df3103622b7de05f4e35b22a2c94b4a46eab4efc Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 14 Nov 2018 13:16:56 +0000 Subject: COMPMID-1088: Use IMemoryRegion in interfaces where possible -Simplifies import memory interface -Changes the used of void** handles with appropriate interfaces. Change-Id: I5918c855c11f46352058864623336b352162a4b7 --- src/runtime/CL/CLMemoryRegion.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/runtime/CL/CLMemoryRegion.cpp') diff --git a/src/runtime/CL/CLMemoryRegion.cpp b/src/runtime/CL/CLMemoryRegion.cpp index 15fd7f333e..9578d73934 100644 --- a/src/runtime/CL/CLMemoryRegion.cpp +++ b/src/runtime/CL/CLMemoryRegion.cpp @@ -48,9 +48,10 @@ void *ICLMemoryRegion::buffer() const return _mapping; } -void **ICLMemoryRegion::handle() +std::unique_ptr ICLMemoryRegion::extract_subregion(size_t offset, size_t size) { - return reinterpret_cast(&_mem); + ARM_COMPUTE_UNUSED(offset, size); + return nullptr; } CLBufferMemoryRegion::CLBufferMemoryRegion(cl::Context ctx, cl_mem_flags flags, size_t size) @@ -62,6 +63,12 @@ CLBufferMemoryRegion::CLBufferMemoryRegion(cl::Context ctx, cl_mem_flags flags, } } +CLBufferMemoryRegion::CLBufferMemoryRegion(const cl::Buffer &buffer) + : ICLMemoryRegion(buffer.getInfo(), buffer.getInfo()) +{ + _mem = buffer; +} + void *CLBufferMemoryRegion::ptr() { return nullptr; -- cgit v1.2.1