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/CLHarrisCorners.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/runtime/CL/functions/CLHarrisCorners.cpp') diff --git a/src/runtime/CL/functions/CLHarrisCorners.cpp b/src/runtime/CL/functions/CLHarrisCorners.cpp index 45b93a5be0..9d8ebceb30 100644 --- a/src/runtime/CL/functions/CLHarrisCorners.cpp +++ b/src/runtime/CL/functions/CLHarrisCorners.cpp @@ -24,8 +24,6 @@ #include "arm_compute/runtime/CL/functions/CLHarrisCorners.h" #include "arm_compute/core/CL/OpenCL.h" -#include "arm_compute/core/CL/kernels/CLFillBorderKernel.h" -#include "arm_compute/core/CL/kernels/CLHarrisCornersKernel.h" #include "arm_compute/core/Error.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Validate.h" @@ -35,6 +33,10 @@ #include "arm_compute/runtime/CL/functions/CLSobel7x7.h" #include "arm_compute/runtime/ITensorAllocator.h" #include "arm_compute/runtime/Scheduler.h" +#include "src/core/CL/kernels/CLFillBorderKernel.h" +#include "src/core/CL/kernels/CLHarrisCornersKernel.h" +#include "src/core/CL/kernels/CLSobel5x5Kernel.h" +#include "src/core/CL/kernels/CLSobel7x7Kernel.h" #include "support/MemorySupport.h" #include @@ -45,12 +47,12 @@ using namespace arm_compute; CLHarrisCorners::CLHarrisCorners(std::shared_ptr memory_manager) // NOLINT : _memory_group(std::move(memory_manager)), _sobel(nullptr), - _harris_score(), + _harris_score(support::cpp14::make_unique()), _non_max_suppr(), _candidates(), _sort_euclidean(), - _border_gx(), - _border_gy(), + _border_gx(support::cpp14::make_unique()), + _border_gy(support::cpp14::make_unique()), _gx(), _gy(), _score(), @@ -61,6 +63,8 @@ CLHarrisCorners::CLHarrisCorners(std::shared_ptr memory_manager) { } +CLHarrisCorners::~CLHarrisCorners() = default; + void CLHarrisCorners::configure(ICLImage *input, float threshold, float min_dist, float sensitivity, int32_t gradient_size, int32_t block_size, ICLKeyPointArray *corners, BorderMode border_mode, uint8_t constant_border_value, bool use_fp16) @@ -133,11 +137,11 @@ void CLHarrisCorners::configure(const CLCompileContext &compile_context, ICLImag _memory_group.manage(&_score); // Set/init Harris Score kernel accordingly with block_size - _harris_score.configure(compile_context, &_gx, &_gy, &_score, block_size, pow4_normalization_factor, threshold, sensitivity, border_mode == BorderMode::UNDEFINED); + _harris_score->configure(compile_context, &_gx, &_gy, &_score, block_size, pow4_normalization_factor, threshold, sensitivity, border_mode == BorderMode::UNDEFINED); // Configure border filling using harris score kernel's block size - _border_gx.configure(compile_context, &_gx, _harris_score.border_size(), border_mode, PixelValue(constant_border_value)); - _border_gy.configure(compile_context, &_gy, _harris_score.border_size(), border_mode, PixelValue(constant_border_value)); + _border_gx->configure(compile_context, &_gx, _harris_score->border_size(), border_mode, PixelValue(constant_border_value)); + _border_gy->configure(compile_context, &_gy, _harris_score->border_size(), border_mode, PixelValue(constant_border_value)); // Allocate intermediate buffers _gx.allocator()->allocate(); @@ -175,11 +179,11 @@ void CLHarrisCorners::run() _sobel->run(); // Fill border before harris score kernel - CLScheduler::get().enqueue(_border_gx, false); - CLScheduler::get().enqueue(_border_gy, false); + CLScheduler::get().enqueue(*_border_gx, false); + CLScheduler::get().enqueue(*_border_gy, false); // Run harris score kernel - CLScheduler::get().enqueue(_harris_score, false); + CLScheduler::get().enqueue(*_harris_score, false); // Run non-maxima suppression _non_max_suppr.run(); -- cgit v1.2.1