diff options
Diffstat (limited to 'src/core/CL/CLHelpers.cpp')
-rw-r--r-- | src/core/CL/CLHelpers.cpp | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/core/CL/CLHelpers.cpp b/src/core/CL/CLHelpers.cpp index aff897738a..6af378c7ab 100644 --- a/src/core/CL/CLHelpers.cpp +++ b/src/core/CL/CLHelpers.cpp @@ -22,12 +22,13 @@ * 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" #include "arm_compute/core/Types.h" +#include "src/core/gpu/cl/ClCompileContext.h" + +#include "src/core/gpu/cl/ClKernelLibrary.h" #include <utility> #include <vector> @@ -386,26 +387,15 @@ size_t get_cl_image_pitch_alignment(const cl::Device &device) } } -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())); - } -} - cl::Kernel create_kernel(const CLCompileContext &ctx, const std::string &kernel_name, const std::set<std::string> &build_opts) { - const std::string program_name = CLKernelLibrary::get().get_program_name(kernel_name); - std::pair<std::string, bool> kernel_src = CLKernelLibrary::get().get_program(program_name); - const std::string kernel_path = CLKernelLibrary::get().get_kernel_path(); - return static_cast<cl::Kernel>(ctx.create_kernel(kernel_name, program_name, kernel_src.first, kernel_path, build_opts, kernel_src.second)); + opencl::ClKernelLibrary &klib = opencl::ClKernelLibrary::get(); + + const std::string program_name = klib.program_name(kernel_name); + auto kernel_src = klib.program(program_name); + const std::string kernel_path = klib.kernel_path(); + + return static_cast<cl::Kernel>(ctx.create_kernel(kernel_name, program_name, kernel_src.program, kernel_path, build_opts, kernel_src.is_binary)); } cl::NDRange create_lws_hint_parallel_implementations(unsigned int input_dimension, unsigned int vector_size) |