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/CLMemoryRegion.cpp | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'src/runtime/CL/CLMemoryRegion.cpp') diff --git a/src/runtime/CL/CLMemoryRegion.cpp b/src/runtime/CL/CLMemoryRegion.cpp index 0952139a8b..780a563d63 100644 --- a/src/runtime/CL/CLMemoryRegion.cpp +++ b/src/runtime/CL/CLMemoryRegion.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -23,16 +23,15 @@ */ #include "arm_compute/runtime/CL/CLMemoryRegion.h" -#include "arm_compute/core/CL/CLCoreRuntimeContext.h" #include "arm_compute/core/Error.h" #include "arm_compute/runtime/CL/CLScheduler.h" namespace arm_compute { -ICLMemoryRegion::ICLMemoryRegion(CLCoreRuntimeContext *ctx, size_t size) +ICLMemoryRegion::ICLMemoryRegion(size_t size) : IMemoryRegion(size), - _queue((ctx != nullptr) ? ctx->queue() : CLScheduler::get().queue()), - _ctx((ctx != nullptr) ? ctx->context() : CLScheduler::get().context()), + _queue(CLScheduler::get().queue()), + _ctx(CLScheduler::get().context()), _mapping(nullptr), _mem() { @@ -59,17 +58,17 @@ std::unique_ptr ICLMemoryRegion::extract_subregion(size_t offset, return nullptr; } -CLBufferMemoryRegion::CLBufferMemoryRegion(CLCoreRuntimeContext *ctx, cl_mem_flags flags, size_t size) - : ICLMemoryRegion(ctx, size) +CLBufferMemoryRegion::CLBufferMemoryRegion(cl_mem_flags flags, size_t size) + : ICLMemoryRegion(size) { if(_size != 0) { - _mem = cl::Buffer((ctx != nullptr) ? ctx->context() : CLScheduler::get().context(), flags, _size); + _mem = cl::Buffer(CLScheduler::get().context(), flags, _size); } } -CLBufferMemoryRegion::CLBufferMemoryRegion(const cl::Buffer &buffer, CLCoreRuntimeContext *ctx) - : ICLMemoryRegion(ctx, buffer.getInfo()) +CLBufferMemoryRegion::CLBufferMemoryRegion(const cl::Buffer &buffer) + : ICLMemoryRegion(buffer.getInfo()) { _mem = buffer; } @@ -93,15 +92,15 @@ void CLBufferMemoryRegion::unmap(cl::CommandQueue &q) _mapping = nullptr; } -ICLSVMMemoryRegion::ICLSVMMemoryRegion(CLCoreRuntimeContext *ctx, cl_mem_flags flags, size_t size, size_t alignment) - : ICLMemoryRegion(ctx, size), _ptr(nullptr) +ICLSVMMemoryRegion::ICLSVMMemoryRegion(cl_mem_flags flags, size_t size, size_t alignment) + : ICLMemoryRegion(size), _ptr(nullptr) { if(size != 0) { - _ptr = clSVMAlloc((ctx != nullptr) ? ctx->context().get() : CLScheduler::get().context().get(), flags, size, alignment); + _ptr = clSVMAlloc(CLScheduler::get().context().get(), flags, size, alignment); if(_ptr != nullptr) { - _mem = cl::Buffer((ctx != nullptr) ? ctx->context() : CLScheduler::get().context(), CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, _size, _ptr); + _mem = cl::Buffer(CLScheduler::get().context(), CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, _size, _ptr); } } } @@ -127,8 +126,8 @@ void *ICLSVMMemoryRegion::ptr() return _ptr; } -CLCoarseSVMMemoryRegion::CLCoarseSVMMemoryRegion(CLCoreRuntimeContext *ctx, cl_mem_flags flags, size_t size, size_t alignment) - : ICLSVMMemoryRegion(ctx, flags, size, alignment) +CLCoarseSVMMemoryRegion::CLCoarseSVMMemoryRegion(cl_mem_flags flags, size_t size, size_t alignment) + : ICLSVMMemoryRegion(flags, size, alignment) { } @@ -147,8 +146,8 @@ void CLCoarseSVMMemoryRegion::unmap(cl::CommandQueue &q) _mapping = nullptr; } -CLFineSVMMemoryRegion::CLFineSVMMemoryRegion(CLCoreRuntimeContext *ctx, cl_mem_flags flags, size_t size, size_t alignment) - : ICLSVMMemoryRegion(ctx, flags, size, alignment) +CLFineSVMMemoryRegion::CLFineSVMMemoryRegion(cl_mem_flags flags, size_t size, size_t alignment) + : ICLSVMMemoryRegion(flags, size, alignment) { } -- cgit v1.2.1