COMPMID-3638: Move NEON kernels
Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com>
Change-Id: Ieed3e4bc8be7fef80c90c5094599b477a56fc473
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4285
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
diff --git a/src/runtime/NEON/functions/NEPadLayer.cpp b/src/runtime/NEON/functions/NEPadLayer.cpp
index 03c597a..92659f3 100644
--- a/src/runtime/NEON/functions/NEPadLayer.cpp
+++ b/src/runtime/NEON/functions/NEPadLayer.cpp
@@ -27,7 +27,10 @@
#include "arm_compute/core/Types.h"
#include "arm_compute/core/utils/misc/ShapeCalculator.h"
+#include "src/core/NEON/kernels/NECopyKernel.h"
+#include "src/core/NEON/kernels/NEPadLayerKernel.h"
#include "src/core/helpers/AutoConfiguration.h"
+#include "support/MemorySupport.h"
namespace arm_compute
{
@@ -47,6 +50,8 @@
}
} // namespace
+NEPadLayer::~NEPadLayer() = default;
+
NEPadLayer::NEPadLayer()
: _copy_kernel(), _pad_kernel(), _mode(), _padding(), _num_dimensions(0), _slice_functions(), _concat_functions(), _slice_results(), _concat_results()
{
@@ -54,7 +59,8 @@
void NEPadLayer::configure_constant_mode(ITensor *input, ITensor *output, const PaddingList &padding, const PixelValue constant_value)
{
- _pad_kernel.configure(input, output, padding, constant_value, PaddingMode::CONSTANT);
+ _pad_kernel = arm_compute::support::cpp14::make_unique<NEPadLayerKernel>();
+ _pad_kernel->configure(input, output, padding, constant_value, PaddingMode::CONSTANT);
}
void NEPadLayer::configure_reflect_symmetric_mode(ITensor *input, ITensor *output)
@@ -195,7 +201,8 @@
else
{
// Copy the input to the whole output if no padding is applied
- _copy_kernel.configure(input, output);
+ _copy_kernel = arm_compute::support::cpp14::make_unique<NECopyKernel>();
+ _copy_kernel->configure(input, output);
}
}
@@ -251,7 +258,7 @@
{
case PaddingMode::CONSTANT:
{
- NEScheduler::get().schedule(&_pad_kernel, Window::DimZ);
+ NEScheduler::get().schedule(_pad_kernel.get(), Window::DimZ);
break;
}
case PaddingMode::REFLECT:
@@ -280,7 +287,7 @@
}
else
{
- NEScheduler::get().schedule(&_copy_kernel, Window::DimY);
+ NEScheduler::get().schedule(_copy_kernel.get(), Window::DimY);
}
}
} // namespace arm_compute