aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/functions/CLMinMaxLocation.cpp
diff options
context:
space:
mode:
authorSang-Hoon Park <sang-hoon.park@arm.com>2020-10-21 15:58:54 +0100
committerSang-Hoon Park <sang-hoon.park@arm.com>2020-11-07 08:07:22 +0000
commitbef7fa27b0d231a8649952f60808132d109b6345 (patch)
tree7543c66a473d90e28b4860986fad77afa5115043 /src/runtime/CL/functions/CLMinMaxLocation.cpp
parentb9531540dadce8331a703c32456f3c9defdfefa9 (diff)
downloadComputeLibrary-bef7fa27b0d231a8649952f60808132d109b6345.tar.gz
COMPMID-3639: (3RDPARTY_UPDATE) Move CL kernels to src
Change-Id: I10d27db788e5086adae1841e3e2441cd9b76ef84 Signed-off-by: Sang-Hoon Park <sang-hoon.park@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4310 Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/CL/functions/CLMinMaxLocation.cpp')
-rw-r--r--src/runtime/CL/functions/CLMinMaxLocation.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/runtime/CL/functions/CLMinMaxLocation.cpp b/src/runtime/CL/functions/CLMinMaxLocation.cpp
index a27defe2f7..3ddd4d04ed 100644
--- a/src/runtime/CL/functions/CLMinMaxLocation.cpp
+++ b/src/runtime/CL/functions/CLMinMaxLocation.cpp
@@ -22,14 +22,15 @@
* SOFTWARE.
*/
#include "arm_compute/runtime/CL/functions/CLMinMaxLocation.h"
-
#include "arm_compute/core/CL/CLHelpers.h"
+#include "src/core/CL/kernels/CLMinMaxLocationKernel.h"
+#include "support/MemorySupport.h"
namespace arm_compute
{
CLMinMaxLocation::CLMinMaxLocation()
- : _min_max_kernel(),
- _min_max_loc_kernel(),
+ : _min_max_kernel(support::cpp14::make_unique<CLMinMaxKernel>()),
+ _min_max_loc_kernel(support::cpp14::make_unique<CLMinMaxLocationKernel>()),
_min_max_vals(),
_min_max_count_vals(),
_min(nullptr),
@@ -41,6 +42,8 @@ CLMinMaxLocation::CLMinMaxLocation()
{
}
+CLMinMaxLocation::~CLMinMaxLocation() = default;
+
void CLMinMaxLocation::configure(const ICLImage *input, void *min, void *max, CLCoordinates2DArray *min_loc, CLCoordinates2DArray *max_loc, uint32_t *min_count, uint32_t *max_count)
{
configure(CLKernelLibrary::get().get_compile_context(), input, min, max, min_loc, max_loc, min_count, max_count);
@@ -62,16 +65,16 @@ void CLMinMaxLocation::configure(const CLCompileContext &compile_context, const
_min_loc = min_loc;
_max_loc = max_loc;
- _min_max_kernel.configure(compile_context, input, &_min_max_vals);
- _min_max_loc_kernel.configure(compile_context, input, &_min_max_vals, &_min_max_count_vals, _min_loc, _max_loc);
+ _min_max_kernel->configure(compile_context, input, &_min_max_vals);
+ _min_max_loc_kernel->configure(compile_context, input, &_min_max_vals, &_min_max_count_vals, _min_loc, _max_loc);
}
void CLMinMaxLocation::run()
{
cl::CommandQueue q = CLScheduler::get().queue();
- CLScheduler::get().enqueue(_min_max_kernel, false);
- CLScheduler::get().enqueue(_min_max_loc_kernel, false);
+ CLScheduler::get().enqueue(*_min_max_kernel, false);
+ CLScheduler::get().enqueue(*_min_max_loc_kernel, false);
// Update min and max
q.enqueueReadBuffer(_min_max_vals, CL_FALSE, 0 * sizeof(int32_t), sizeof(int32_t), static_cast<int32_t *>(_min));