diff options
author | Pablo Tello <pablo.tello@arm.com> | 2019-09-24 11:03:47 +0100 |
---|---|---|
committer | Pablo Marquez <pablo.tello@arm.com> | 2019-10-15 14:05:55 +0000 |
commit | db8485ac24135f17e9882c76196924435abc064f (patch) | |
tree | dfe4ff6a50012ac93c6b1cf3fb29c099a7592522 /src/core/CL/CLHelpers.cpp | |
parent | a046e164b96a8441b2fa14ef578f7db46a0e97da (diff) | |
download | ComputeLibrary-db8485ac24135f17e9882c76196924435abc064f.tar.gz |
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 <pablo.tello@arm.com>
Reviewed-on: https://review.mlplatform.org/c/1998
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/CLHelpers.cpp')
-rw-r--r-- | src/core/CL/CLHelpers.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/CL/CLHelpers.cpp b/src/core/CL/CLHelpers.cpp index d051810090..a3c73677c7 100644 --- a/src/core/CL/CLHelpers.cpp +++ b/src/core/CL/CLHelpers.cpp @@ -22,6 +22,8 @@ * SOFTWARE. */ #include "arm_compute/core/CL/CLHelpers.h" +#include "arm_compute/core/CL/CLCoreRuntimeContext.h" +#include "arm_compute/core/CL/CLKernelLibrary.h" #include "arm_compute/core/CL/CLTypes.h" #include "arm_compute/core/Error.h" #include "arm_compute/core/Log.h" @@ -283,4 +285,18 @@ bool preferred_dummy_work_items_support(const cl::Device &device) // TODO (COMPMID-2044) return true; } + +cl::Kernel create_opencl_kernel(CLCoreRuntimeContext *ctx, const std::string &kernel_name, const CLBuildOptions &build_opts) +{ + if(ctx && ctx->kernel_library()) + { + //New api going through the core context + return static_cast<cl::Kernel>(ctx->kernel_library()->create_kernel(kernel_name, build_opts.options())); + } + else + { + //Legacy code through the singleton + return static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, build_opts.options())); + } +} } // namespace arm_compute |