From 02aabcca4904adba592fc9840085c87f336d11fb Mon Sep 17 00:00:00 2001 From: Isabella Gottardi Date: Thu, 12 Oct 2017 17:28:51 +0100 Subject: COMPMID-583 - Implemented reference implementation and validation tests (NEON and CL) for Histogram Change-Id: Iccf6b4483cb8394dab2f861a737583126f9bed81 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/91601 Tested-by: Kaizen Reviewed-by: Georgios Pinitas --- src/core/CL/kernels/CLHistogramKernel.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/core/CL/kernels/CLHistogramKernel.cpp') diff --git a/src/core/CL/kernels/CLHistogramKernel.cpp b/src/core/CL/kernels/CLHistogramKernel.cpp index 87ee5fb74e..7b715abb36 100644 --- a/src/core/CL/kernels/CLHistogramKernel.cpp +++ b/src/core/CL/kernels/CLHistogramKernel.cpp @@ -115,18 +115,20 @@ void CLHistogramKernel::run(const Window &window, cl::CommandQueue &queue) ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this); ARM_COMPUTE_ERROR_ON_MISMATCHING_WINDOWS(ICLKernel::window(), window); - if(_input->info()->dimension(0) < pixels_per_item) - { - return; - } - + // TODO (COMPMID-679): Add CLMemFill _output->map(queue, true); ARM_COMPUTE_ERROR_ON(_output->buffer() == nullptr); memset(_output->buffer(), 0, _output->size()); _output->unmap(queue); - Window slice = window.first_slice_window_2D(); - cl::NDRange lws = cl::NDRange(local_x_size, 1); + if(_input->info()->dimension(0) < pixels_per_item) + { + return; + } + + Window slice = window.first_slice_window_2D(); + const unsigned int gws_x = (window.x().end() - window.x().start()) / window.x().step(); + cl::NDRange lws = (local_x_size < gws_x) ? cl::NDRange(local_x_size, 1) : cl::NDRange(1, 1); do { -- cgit v1.2.1