aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/NEON/functions/NEPadLayer.cpp
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2020-10-21 00:04:14 +0100
committerMichalis Spyrou <michalis.spyrou@arm.com>2020-11-03 15:10:47 +0000
commitebcebf1dee7f8314976b1e0cabd62b4cf893d765 (patch)
tree95d3e691a0e88a3e213a1d30446a9224497f2055 /src/runtime/NEON/functions/NEPadLayer.cpp
parentda4b1b2055d96aaf73704eb9b0b82d74dc2d699c (diff)
downloadComputeLibrary-ebcebf1dee7f8314976b1e0cabd62b4cf893d765.tar.gz
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>
Diffstat (limited to 'src/runtime/NEON/functions/NEPadLayer.cpp')
-rw-r--r--src/runtime/NEON/functions/NEPadLayer.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/runtime/NEON/functions/NEPadLayer.cpp b/src/runtime/NEON/functions/NEPadLayer.cpp
index 03c597a3bf..92659f39a2 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 @@ uint32_t last_padding_dimension(const PaddingList &padding)
}
} // 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 @@ NEPadLayer::NEPadLayer()
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 @@ void NEPadLayer::configure(ITensor *input, ITensor *output, const PaddingList &p
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 @@ void NEPadLayer::run()
{
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 @@ void NEPadLayer::run()
}
else
{
- NEScheduler::get().schedule(&_copy_kernel, Window::DimY);
+ NEScheduler::get().schedule(_copy_kernel.get(), Window::DimY);
}
}
} // namespace arm_compute