diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-05-04 21:39:57 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-05-12 05:50:43 +0000 |
commit | 2cd5b31d729984f938e2253532424daf157029c4 (patch) | |
tree | 00ea795cfd043742507feafd04ae9b9cce01adca /src/runtime/CL/CLBufferAllocator.cpp | |
parent | ee22030441e869a7c4ff632d27a7d45c6168a14e (diff) | |
download | ComputeLibrary-2cd5b31d729984f938e2253532424daf157029c4.tar.gz |
Remove unused CLCoreRuntimeContext
CLCoreRuntime context is currently unused and is planned to be replaced
by the Context infrastructure
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: Ic2874800960ca954f647e8867e7db951ce823e1c
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5571
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/CL/CLBufferAllocator.cpp')
-rw-r--r-- | src/runtime/CL/CLBufferAllocator.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/runtime/CL/CLBufferAllocator.cpp b/src/runtime/CL/CLBufferAllocator.cpp index 3673d65111..e06ef3d37d 100644 --- a/src/runtime/CL/CLBufferAllocator.cpp +++ b/src/runtime/CL/CLBufferAllocator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -23,7 +23,6 @@ */ #include "arm_compute/runtime/CL/CLBufferAllocator.h" -#include "arm_compute/core/CL/CLCoreRuntimeContext.h" #include "arm_compute/core/CL/OpenCL.h" #include "arm_compute/core/Error.h" #include "arm_compute/runtime/CL/CLMemoryRegion.h" @@ -33,23 +32,10 @@ namespace arm_compute { -CLBufferAllocator::CLBufferAllocator(CLCoreRuntimeContext *ctx) - : _ctx(ctx) -{ -} - void *CLBufferAllocator::allocate(size_t size, size_t alignment) { ARM_COMPUTE_UNUSED(alignment); - cl_mem buf; - if(_ctx == nullptr) - { - buf = clCreateBuffer(CLScheduler::get().context().get(), CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE, size, nullptr, nullptr); - } - else - { - buf = clCreateBuffer(_ctx->context().get(), CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE, size, nullptr, nullptr); - } + cl_mem buf{ clCreateBuffer(CLScheduler::get().context().get(), CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE, size, nullptr, nullptr) }; return static_cast<void *>(buf); } @@ -62,6 +48,6 @@ void CLBufferAllocator::free(void *ptr) std::unique_ptr<IMemoryRegion> CLBufferAllocator::make_region(size_t size, size_t alignment) { ARM_COMPUTE_UNUSED(alignment); - return std::make_unique<CLBufferMemoryRegion>(_ctx, CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE, size); + return std::make_unique<CLBufferMemoryRegion>(CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE, size); } } // namespace arm_compute |