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/CLHelpers.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/runtime/CL/CLHelpers.cpp') diff --git a/src/runtime/CL/CLHelpers.cpp b/src/runtime/CL/CLHelpers.cpp index edfc8ed2aa..c4c7ee2107 100644 --- a/src/runtime/CL/CLHelpers.cpp +++ b/src/runtime/CL/CLHelpers.cpp @@ -26,6 +26,7 @@ #include "arm_compute/core/CL/CLHelpers.h" #include "arm_compute/core/Error.h" +#include "arm_compute/runtime/CL/CLRuntimeContext.h" namespace { @@ -103,4 +104,19 @@ create_opencl_context_and_device() ARM_COMPUTE_ERROR_ON_MSG(err != CL_SUCCESS, "Failed to create OpenCL context"); return std::make_tuple(cl_context, device, err); } + +void schedule_kernel_on_ctx(CLRuntimeContext *ctx, ICLKernel *kernel, bool flush) +{ + ARM_COMPUTE_ERROR_ON_NULLPTR(kernel); + if(ctx) + { + ARM_COMPUTE_ERROR_ON(ctx->gpu_scheduler() == nullptr); + ctx->gpu_scheduler()->enqueue(*kernel, flush); + } + else + { + CLScheduler::get().enqueue(*kernel, flush); + } +} + } // namespace arm_compute -- cgit v1.2.1