aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/CLScheduler.cpp
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2021-04-20 11:26:21 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2021-04-21 20:48:28 +0000
commit402740da11c4fd2a9dc7aee5dadf3b1fdda0afde (patch)
tree61501d2f0af7115b87d26907d6ca9a3d00f4ef5e /src/runtime/CL/CLScheduler.cpp
parentbff2f9f2f92bf7a8d2f7532df0329dedfbe84693 (diff)
downloadComputeLibrary-402740da11c4fd2a9dc7aee5dadf3b1fdda0afde.tar.gz
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 <michalis.spyrou@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5475 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'src/runtime/CL/CLScheduler.cpp')
-rw-r--r--src/runtime/CL/CLScheduler.cpp10
1 files changed, 5 insertions, 5 deletions
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)