diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-04-23 16:26:46 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:50:15 +0000 |
commit | 99d40951df87790fb884ce1c42d5e2a7a0009ee0 (patch) | |
tree | 774e2c6d0849a7fb3f13c7cc4773f7cbfea448fb /src/runtime/CL/CLBufferAllocator.cpp | |
parent | cda0c38373b2f114509392ba16ef04e8c1e0f819 (diff) | |
download | ComputeLibrary-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 'src/runtime/CL/CLBufferAllocator.cpp')
-rw-r--r-- | src/runtime/CL/CLBufferAllocator.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/runtime/CL/CLBufferAllocator.cpp b/src/runtime/CL/CLBufferAllocator.cpp index 9a5c13ac5a..84789e70d2 100644 --- a/src/runtime/CL/CLBufferAllocator.cpp +++ b/src/runtime/CL/CLBufferAllocator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -22,9 +22,11 @@ * SOFTWARE. */ #include "arm_compute/runtime/CL/CLBufferAllocator.h" +#include "arm_compute/runtime/CL/CLMemoryRegion.h" #include "arm_compute/core/CL/OpenCL.h" #include "arm_compute/core/Error.h" +#include "support/ToolchainSupport.h" #include <cstddef> @@ -47,3 +49,9 @@ void CLBufferAllocator::free(void *ptr) ARM_COMPUTE_ERROR_ON(ptr == nullptr); clReleaseMemObject(static_cast<cl_mem>(ptr)); } + +std::unique_ptr<IMemoryRegion> CLBufferAllocator::make_region(size_t size, size_t alignment) +{ + ARM_COMPUTE_UNUSED(alignment); + return arm_compute::support::cpp14::make_unique<CLBufferMemoryRegion>(_context, CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE, size); +} |