aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/functions/CLGaussian5x5.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/CLGaussian5x5.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/CLGaussian5x5.cpp')
-rw-r--r--src/runtime/CL/functions/CLGaussian5x5.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/runtime/CL/functions/CLGaussian5x5.cpp b/src/runtime/CL/functions/CLGaussian5x5.cpp
index 1fe2fddfb6..f7470d4ecf 100644
--- a/src/runtime/CL/functions/CLGaussian5x5.cpp
+++ b/src/runtime/CL/functions/CLGaussian5x5.cpp
@@ -24,22 +24,30 @@
#include "arm_compute/runtime/CL/functions/CLGaussian5x5.h"
#include "arm_compute/core/CL/ICLTensor.h"
-#include "arm_compute/core/CL/kernels/CLGaussian5x5Kernel.h"
#include "arm_compute/core/PixelValue.h"
#include "arm_compute/core/TensorInfo.h"
#include "arm_compute/core/Validate.h"
#include "arm_compute/runtime/CL/CLScheduler.h"
#include "arm_compute/runtime/ITensorAllocator.h"
+#include "src/core/CL/kernels/CLFillBorderKernel.h"
+#include "src/core/CL/kernels/CLGaussian5x5Kernel.h"
+#include "support/MemorySupport.h"
#include <utility>
using namespace arm_compute;
CLGaussian5x5::CLGaussian5x5(std::shared_ptr<IMemoryManager> memory_manager)
- : _memory_group(std::move(memory_manager)), _kernel_hor(), _kernel_vert(), _border_handler(), _tmp()
+ : _memory_group(std::move(memory_manager)),
+ _kernel_hor(support::cpp14::make_unique<CLGaussian5x5HorKernel>()),
+ _kernel_vert(support::cpp14::make_unique<CLGaussian5x5VertKernel>()),
+ _border_handler(support::cpp14::make_unique<CLFillBorderKernel>()),
+ _tmp()
{
}
+CLGaussian5x5::~CLGaussian5x5() = default;
+
void CLGaussian5x5::configure(ICLTensor *input, ICLTensor *output, BorderMode border_mode, uint8_t constant_border_value)
{
configure(CLKernelLibrary::get().get_compile_context(), input, output, border_mode, constant_border_value);
@@ -55,9 +63,9 @@ void CLGaussian5x5::configure(const CLCompileContext &compile_context, ICLTensor
_memory_group.manage(&_tmp);
// Configure kernels
- _kernel_hor.configure(compile_context, input, &_tmp, border_mode == BorderMode::UNDEFINED);
- _kernel_vert.configure(compile_context, &_tmp, output, border_mode == BorderMode::UNDEFINED);
- _border_handler.configure(compile_context, input, _kernel_hor.border_size(), border_mode, PixelValue(constant_border_value));
+ _kernel_hor->configure(compile_context, input, &_tmp, border_mode == BorderMode::UNDEFINED);
+ _kernel_vert->configure(compile_context, &_tmp, output, border_mode == BorderMode::UNDEFINED);
+ _border_handler->configure(compile_context, input, _kernel_hor->border_size(), border_mode, PixelValue(constant_border_value));
// Allocate intermediate buffers
_tmp.allocator()->allocate();
@@ -65,10 +73,10 @@ void CLGaussian5x5::configure(const CLCompileContext &compile_context, ICLTensor
void CLGaussian5x5::run()
{
- CLScheduler::get().enqueue(_border_handler, false);
+ CLScheduler::get().enqueue(*_border_handler, false);
MemoryGroupResourceScope scope_mg(_memory_group);
- CLScheduler::get().enqueue(_kernel_hor, false);
- CLScheduler::get().enqueue(_kernel_vert);
+ CLScheduler::get().enqueue(*_kernel_hor, false);
+ CLScheduler::get().enqueue(*_kernel_vert);
}