diff options
author | Manuel Bottini <manuel.bottini@arm.com> | 2020-04-08 10:15:51 +0100 |
---|---|---|
committer | Manuel Bottini <manuel.bottini@arm.com> | 2020-04-17 14:10:38 +0000 |
commit | 4c6bd514a8d424a29b776754f1b3426fa3a8c339 (patch) | |
tree | ed20ea238ae069ab138b62ea6879e0c1b955b606 /src/core/CL/kernels/CLHistogramKernel.cpp | |
parent | d2f6d96cdc2ad2169c4abd0a8c4884f61ed6d186 (diff) | |
download | ComputeLibrary-4c6bd514a8d424a29b776754f1b3426fa3a8c339.tar.gz |
COMPMID-3280: Make all ML primitives for CL use the new interface - Part 1
- Only CLKernels have been updated
Change-Id: Ife55b847c2e39e712a186eb6ca452503d5b66937
Signed-off-by: Manuel Bottini <manuel.bottini@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3001
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
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 |