diff options
Diffstat (limited to 'src/core/CL/kernels/CLHistogramKernel.cpp')
-rw-r--r-- | src/core/CL/kernels/CLHistogramKernel.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/CL/kernels/CLHistogramKernel.cpp b/src/core/CL/kernels/CLHistogramKernel.cpp index adb998d2f5..5c44f6eec5 100644 --- a/src/core/CL/kernels/CLHistogramKernel.cpp +++ b/src/core/CL/kernels/CLHistogramKernel.cpp @@ -53,6 +53,11 @@ CLHistogramKernel::CLHistogramKernel() void CLHistogramKernel::configure(const ICLImage *input, ICLDistribution1D *output) { + configure(CLKernelLibrary::get().get_compile_context(), input, output); +} + +void CLHistogramKernel::configure(CLCompileContext &compile_context, const ICLImage *input, ICLDistribution1D *output) +{ ARM_COMPUTE_ERROR_ON_TENSOR_NOT_2D(input); ARM_COMPUTE_ERROR_ON(nullptr == output); @@ -84,7 +89,7 @@ void CLHistogramKernel::configure(const ICLImage *input, ICLDistribution1D *outp // Create kernel bool is_fixed_size = (256 == num_bins) && (1 == window_size) && (0 == offset) && (256 == offrange); const std::string kernel_name = is_fixed_size ? "hist_local_kernel_fixed" : "hist_local_kernel"; - _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name)); + _kernel = create_kernel(compile_context, kernel_name); // Set static kernel arguments unsigned int idx = num_arguments_per_2D_tensor(); //Skip the input and output parameters @@ -158,6 +163,11 @@ CLHistogramBorderKernel::CLHistogramBorderKernel() void CLHistogramBorderKernel::configure(const ICLImage *input, ICLDistribution1D *output) { + configure(CLKernelLibrary::get().get_compile_context(), input, output); +} + +void CLHistogramBorderKernel::configure(CLCompileContext &compile_context, const ICLImage *input, ICLDistribution1D *output) +{ ARM_COMPUTE_ERROR_ON_TENSOR_NOT_2D(input); ARM_COMPUTE_ERROR_ON(nullptr == output); @@ -190,7 +200,7 @@ void CLHistogramBorderKernel::configure(const ICLImage *input, ICLDistribution1D // Create kernel bool is_fixed_size = (256 == num_bins) && (1 == window_size) && (0 == offset) && (256 == offrange); const std::string kernel_name = is_fixed_size ? "hist_border_kernel_fixed" : "hist_border_kernel"; - _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name)); + _kernel = create_kernel(compile_context, kernel_name); // Set static kernel arguments unsigned int idx = num_arguments_per_2D_tensor(); //Skip the input and output parameters |