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 --- arm_compute/runtime/CL/CLHelpers.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'arm_compute/runtime/CL/CLHelpers.h') diff --git a/arm_compute/runtime/CL/CLHelpers.h b/arm_compute/runtime/CL/CLHelpers.h index f3b11f8b75..84f155afd2 100644 --- a/arm_compute/runtime/CL/CLHelpers.h +++ b/arm_compute/runtime/CL/CLHelpers.h @@ -25,9 +25,12 @@ #define __ARM_COMPUTE_CL_HELPERS_H__ #include "arm_compute/core/CL/OpenCL.h" +#include "arm_compute/runtime/IScheduler.h" namespace arm_compute { +class CLRuntimeContext; +class ICLKernel; /** This function creates an OpenCL context and a device. * * @note In debug builds, the function will automatically enable cl_arm_printf if the driver/device supports it. @@ -37,5 +40,12 @@ namespace arm_compute * a value telling why the function failed. */ std::tuple create_opencl_context_and_device(); +/** Schedules a kernel using the context if not nullptr else uses the legacy scheduling flow. + * + * @param[in] ctx Context to use. + * @param[in] kernel Kernel to schedule. + * @param[in] flush (Optional) Specifies if the command queue will be flushed after running the kernel. + */ +void schedule_kernel_on_ctx(CLRuntimeContext *ctx, ICLKernel *kernel, bool flush = true); } // namespace arm_compute #endif /* __ARM_COMPUTE_CL_HELPERS_H__ */ -- cgit v1.2.1