From 2cd5b31d729984f938e2253532424daf157029c4 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Tue, 4 May 2021 21:39:57 +0100 Subject: Remove unused CLCoreRuntimeContext CLCoreRuntime context is currently unused and is planned to be replaced by the Context infrastructure Signed-off-by: Georgios Pinitas Change-Id: Ic2874800960ca954f647e8867e7db951ce823e1c Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5571 Tested-by: Arm Jenkins Reviewed-by: Michalis Spyrou Comments-Addressed: Arm Jenkins --- src/runtime/CL/CLBufferAllocator.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'src/runtime/CL/CLBufferAllocator.cpp') 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(buf); } @@ -62,6 +48,6 @@ void CLBufferAllocator::free(void *ptr) std::unique_ptr CLBufferAllocator::make_region(size_t size, size_t alignment) { ARM_COMPUTE_UNUSED(alignment); - return std::make_unique(_ctx, CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE, size); + return std::make_unique(CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE, size); } } // namespace arm_compute -- cgit v1.2.1