From db8485ac24135f17e9882c76196924435abc064f Mon Sep 17 00:00:00 2001 From: Pablo Tello Date: Tue, 24 Sep 2019 11:03:47 +0100 Subject: COMPMID-2205: CL runtime context. CL Interfaces implemented. Concrete classes implemented. One test (ActivationLayer) ported to the new interface. Change-Id: I283808bec36ccfc2f13fe048c45cbbee698ce525 Signed-off-by: Pablo Tello Reviewed-on: https://review.mlplatform.org/c/1998 Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas Comments-Addressed: Arm Jenkins --- src/runtime/CL/CLTensor.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/runtime/CL/CLTensor.cpp') diff --git a/src/runtime/CL/CLTensor.cpp b/src/runtime/CL/CLTensor.cpp index 9bbf926b58..a6d0cf77ca 100644 --- a/src/runtime/CL/CLTensor.cpp +++ b/src/runtime/CL/CLTensor.cpp @@ -23,15 +23,21 @@ */ #include "arm_compute/runtime/CL/CLTensor.h" +#include "arm_compute/runtime/CL/CLRuntimeContext.h" #include "arm_compute/runtime/CL/CLScheduler.h" namespace arm_compute { -CLTensor::CLTensor() - : _allocator(this) +CLTensor::CLTensor(IRuntimeContext *ctx) + : _allocator(this, static_cast(ctx)), _ctx(static_cast(ctx)) { } +CLRuntimeContext *CLTensor::context() +{ + return _ctx; +} + TensorInfo *CLTensor::info() const { return &_allocator.info(); @@ -59,12 +65,12 @@ CLTensorAllocator *CLTensor::allocator() void CLTensor::map(bool blocking) { - ICLTensor::map(CLScheduler::get().queue(), blocking); + ICLTensor::map(_ctx == nullptr ? CLScheduler::get().queue() : _ctx->gpu_scheduler()->queue(), blocking); } void CLTensor::unmap() { - ICLTensor::unmap(CLScheduler::get().queue()); + ICLTensor::unmap(_ctx == nullptr ? CLScheduler::get().queue() : _ctx->gpu_scheduler()->queue()); } uint8_t *CLTensor::do_map(cl::CommandQueue &q, bool blocking) @@ -81,4 +87,4 @@ void CLTensor::associate_memory_group(arm_compute::IMemoryGroup *memory_group) { _allocator.set_associated_memory_group(memory_group); } -} // namespace arm_compute \ No newline at end of file +} // namespace arm_compute -- cgit v1.2.1