From bef7fa27b0d231a8649952f60808132d109b6345 Mon Sep 17 00:00:00 2001 From: Sang-Hoon Park Date: Wed, 21 Oct 2020 15:58:54 +0100 Subject: COMPMID-3639: (3RDPARTY_UPDATE) Move CL kernels to src Change-Id: I10d27db788e5086adae1841e3e2441cd9b76ef84 Signed-off-by: Sang-Hoon Park Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4310 Reviewed-by: Georgios Pinitas Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- src/runtime/CL/functions/CLEqualizeHistogram.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'src/runtime/CL/functions/CLEqualizeHistogram.cpp') diff --git a/src/runtime/CL/functions/CLEqualizeHistogram.cpp b/src/runtime/CL/functions/CLEqualizeHistogram.cpp index a1158a71a5..cc927a055b 100644 --- a/src/runtime/CL/functions/CLEqualizeHistogram.cpp +++ b/src/runtime/CL/functions/CLEqualizeHistogram.cpp @@ -28,6 +28,9 @@ #include "arm_compute/core/CL/OpenCL.h" #include "arm_compute/core/Types.h" #include "arm_compute/runtime/CL/CLScheduler.h" +#include "src/core/CL/kernels/CLHistogramKernel.h" +#include "src/core/CL/kernels/CLTableLookupKernel.h" +#include "support/MemorySupport.h" #include #include @@ -83,10 +86,17 @@ void calculate_cum_dist_and_lut(CLDistribution1D &dist, CLDistribution1D &cum_di } // namespace CLEqualizeHistogram::CLEqualizeHistogram() - : _histogram_kernel(), _border_histogram_kernel(), _map_histogram_kernel(), _hist(nr_bins, 0, max_range), _cum_dist(nr_bins, 0, max_range), _cd_lut(nr_bins, DataType::U8) + : _histogram_kernel(support::cpp14::make_unique()), + _border_histogram_kernel(support::cpp14::make_unique()), + _map_histogram_kernel(support::cpp14::make_unique()), + _hist(nr_bins, 0, max_range), + _cum_dist(nr_bins, 0, max_range), + _cd_lut(nr_bins, DataType::U8) { } +CLEqualizeHistogram::~CLEqualizeHistogram() = default; + void CLEqualizeHistogram::configure(const ICLImage *input, ICLImage *output) { configure(CLKernelLibrary::get().get_compile_context(), input, output); @@ -94,22 +104,22 @@ void CLEqualizeHistogram::configure(const ICLImage *input, ICLImage *output) void CLEqualizeHistogram::configure(const CLCompileContext &compile_context, const ICLImage *input, ICLImage *output) { - _histogram_kernel.configure(compile_context, input, &_hist); - _border_histogram_kernel.configure(compile_context, input, &_hist); - _map_histogram_kernel.configure(compile_context, input, &_cd_lut, output); + _histogram_kernel->configure(compile_context, input, &_hist); + _border_histogram_kernel->configure(compile_context, input, &_hist); + _map_histogram_kernel->configure(compile_context, input, &_cd_lut, output); } void CLEqualizeHistogram::run() { // Calculate histogram of input. - CLScheduler::get().enqueue(_histogram_kernel, false); + CLScheduler::get().enqueue(*_histogram_kernel, false); // Calculate remaining pixels when image is not multiple of the elements of histogram kernel - CLScheduler::get().enqueue(_border_histogram_kernel, false); + CLScheduler::get().enqueue(*_border_histogram_kernel, false); // Calculate cumulative distribution of histogram and create LUT. calculate_cum_dist_and_lut(_hist, _cum_dist, _cd_lut); // Map input to output using created LUT. - CLScheduler::get().enqueue(_map_histogram_kernel); + CLScheduler::get().enqueue(*_map_histogram_kernel); } -- cgit v1.2.1