From ebcebf1dee7f8314976b1e0cabd62b4cf893d765 Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Wed, 21 Oct 2020 00:04:14 +0100 Subject: COMPMID-3638: Move NEON kernels Signed-off-by: Michalis Spyrou Change-Id: Ieed3e4bc8be7fef80c90c5094599b477a56fc473 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4285 Comments-Addressed: Arm Jenkins Reviewed-by: Georgios Pinitas Tested-by: Arm Jenkins --- src/runtime/NEON/functions/NEGaussianPyramid.cpp | 32 ++++++++++++++++-------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'src/runtime/NEON/functions/NEGaussianPyramid.cpp') diff --git a/src/runtime/NEON/functions/NEGaussianPyramid.cpp b/src/runtime/NEON/functions/NEGaussianPyramid.cpp index e4e20e041b..30fe70f0ab 100644 --- a/src/runtime/NEON/functions/NEGaussianPyramid.cpp +++ b/src/runtime/NEON/functions/NEGaussianPyramid.cpp @@ -25,16 +25,18 @@ #include "arm_compute/core/Error.h" #include "arm_compute/core/ITensor.h" -#include "arm_compute/core/NEON/kernels/NEGaussianPyramidKernel.h" -#include "arm_compute/core/NEON/kernels/NEScaleKernel.h" #include "arm_compute/core/PixelValue.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Validate.h" #include "arm_compute/runtime/NEON/NEScheduler.h" -#include "arm_compute/runtime/NEON/functions/NEGaussian5x5.h" #include "arm_compute/runtime/Pyramid.h" #include "arm_compute/runtime/Tensor.h" #include "arm_compute/runtime/TensorAllocator.h" +#include "src/core/NEON/kernels/NEFillBorderKernel.h" +#include "src/core/NEON/kernels/NEGaussian5x5Kernel.h" +#include "src/core/NEON/kernels/NEGaussianPyramidKernel.h" +#include "src/core/NEON/kernels/NEScaleKernel.h" +#include "support/MemorySupport.h" #include @@ -45,6 +47,8 @@ NEGaussianPyramid::NEGaussianPyramid() { } +NEGaussianPyramidHalf::~NEGaussianPyramidHalf() = default; + NEGaussianPyramidHalf::NEGaussianPyramidHalf() // NOLINT : _horizontal_border_handler(), _vertical_border_handler(), @@ -94,16 +98,20 @@ void NEGaussianPyramidHalf::configure(const ITensor *input, IPyramid *pyramid, B for(size_t i = 0; i < num_stages; ++i) { /* Configure horizontal kernel */ - _horizontal_reduction[i].configure(_pyramid->get_pyramid_level(i), _tmp.get_pyramid_level(i)); + _horizontal_reduction[i] = arm_compute::support::cpp14::make_unique(); + _horizontal_reduction[i]->configure(_pyramid->get_pyramid_level(i), _tmp.get_pyramid_level(i)); /* Configure vertical kernel */ - _vertical_reduction[i].configure(_tmp.get_pyramid_level(i), _pyramid->get_pyramid_level(i + 1)); + _vertical_reduction[i] = arm_compute::support::cpp14::make_unique(); + _vertical_reduction[i]->configure(_tmp.get_pyramid_level(i), _pyramid->get_pyramid_level(i + 1)); /* Configure border */ - _horizontal_border_handler[i].configure(_pyramid->get_pyramid_level(i), _horizontal_reduction[i].border_size(), border_mode, PixelValue(constant_border_value)); + _horizontal_border_handler[i] = arm_compute::support::cpp14::make_unique(); + _horizontal_border_handler[i]->configure(_pyramid->get_pyramid_level(i), _horizontal_reduction[i]->border_size(), border_mode, PixelValue(constant_border_value)); /* Configure border */ - _vertical_border_handler[i].configure(_tmp.get_pyramid_level(i), _vertical_reduction[i].border_size(), border_mode, PixelValue(pixel_value_u16)); + _vertical_border_handler[i] = arm_compute::support::cpp14::make_unique(); + _vertical_border_handler[i]->configure(_tmp.get_pyramid_level(i), _vertical_reduction[i]->border_size(), border_mode, PixelValue(pixel_value_u16)); } _tmp.allocate(); @@ -122,13 +130,15 @@ void NEGaussianPyramidHalf::run() for(unsigned int i = 0; i < num_levels - 1; ++i) { - NEScheduler::get().schedule(&_horizontal_border_handler[i], Window::DimZ); - NEScheduler::get().schedule(&_horizontal_reduction[i], Window::DimY); - NEScheduler::get().schedule(&_vertical_border_handler[i], Window::DimZ); - NEScheduler::get().schedule(&_vertical_reduction[i], Window::DimY); + NEScheduler::get().schedule(_horizontal_border_handler[i].get(), Window::DimZ); + NEScheduler::get().schedule(_horizontal_reduction[i].get(), Window::DimY); + NEScheduler::get().schedule(_vertical_border_handler[i].get(), Window::DimZ); + NEScheduler::get().schedule(_vertical_reduction[i].get(), Window::DimY); } } +NEGaussianPyramidOrb::~NEGaussianPyramidOrb() = default; + NEGaussianPyramidOrb::NEGaussianPyramidOrb() // NOLINT : _gaus5x5(), _scale_nearest() -- cgit v1.2.1