From 402740da11c4fd2a9dc7aee5dadf3b1fdda0afde Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Tue, 20 Apr 2021 11:26:21 +0100 Subject: Add support for CLVK This patch enables CLVK through the graph API and inside the CLScheduler. By default the Native platform is selected. Selecting CLVK can be done via --target=clvk. Resolves COMPMID-4205 and COMPMID-4206 Change-Id: Ic60744980c6b8a60e776627ea677ed46be88f656 Signed-off-by: Michalis Spyrou Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5475 Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas --- src/runtime/CL/CLScheduler.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/runtime/CL/CLScheduler.cpp') diff --git a/src/runtime/CL/CLScheduler.cpp b/src/runtime/CL/CLScheduler.cpp index f228cf6513..cb5f04ce8b 100644 --- a/src/runtime/CL/CLScheduler.cpp +++ b/src/runtime/CL/CLScheduler.cpp @@ -24,7 +24,6 @@ #include "arm_compute/runtime/CL/CLScheduler.h" #include "arm_compute/core/CL/CLKernelLibrary.h" -#include "arm_compute/runtime/CL/CLHelpers.h" #include "arm_compute/runtime/CL/CLTuner.h" #include "src/core/CL/ICLKernel.h" @@ -96,7 +95,7 @@ bool CLScheduler::is_initialised() const std::once_flag CLScheduler::_initialize_symbols; CLScheduler::CLScheduler() - : _context(), _queue(), _target(GPUTarget::MIDGARD), _is_initialised(false), _cl_tuner(nullptr), _gemm_heuristics(nullptr) + : _context(), _queue(), _target(GPUTarget::MIDGARD), _is_initialised(false), _cl_tuner(nullptr), _gemm_heuristics(nullptr), _backend_type(CLBackendType::Native) { } @@ -119,14 +118,14 @@ void CLScheduler::default_init_with_context(cl::Device &device, cl::Context &ctx } } -void CLScheduler::default_init(ICLTuner *cl_tuner, CLGEMMHeuristicsHandle *gemm_h) +void CLScheduler::default_init(ICLTuner *cl_tuner, CLGEMMHeuristicsHandle *gemm_h, CLBackendType cl_backend_type) { if(!_is_initialised) { cl::Context ctx; cl::Device dev; cl_int err; - std::tie(ctx, dev, err) = create_opencl_context_and_device(); + std::tie(ctx, dev, err) = create_opencl_context_and_device(cl_backend_type); ARM_COMPUTE_ERROR_ON_MSG(err != CL_SUCCESS, "Failed to create OpenCL context"); cl::CommandQueue queue = cl::CommandQueue(ctx, dev); CLKernelLibrary::get().init("./cl_kernels/", ctx, dev); @@ -143,7 +142,7 @@ void CLScheduler::set_context(cl::Context context) CLKernelLibrary::get().set_context(_context); } -void CLScheduler::init(cl::Context context, cl::CommandQueue queue, const cl::Device &device, ICLTuner *cl_tuner, CLGEMMHeuristicsHandle *gemm_h) +void CLScheduler::init(cl::Context context, cl::CommandQueue queue, const cl::Device &device, ICLTuner *cl_tuner, CLGEMMHeuristicsHandle *gemm_h, CLBackendType cl_backend_type) { set_context(std::move(context)); _queue = std::move(queue); @@ -151,6 +150,7 @@ void CLScheduler::init(cl::Context context, cl::CommandQueue queue, const cl::De _is_initialised = true; _cl_tuner = cl_tuner; _gemm_heuristics = gemm_h; + _backend_type = cl_backend_type; } void CLScheduler::enqueue_common(ICLKernel &kernel, ITensorPack &tensors, bool flush) -- cgit v1.2.1