aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL
diff options
context:
space:
mode:
authorMichele Di Giorgio <michele.digiorgio@arm.com>2019-09-20 14:01:48 +0100
committerMichele Di Giorgio <michele.digiorgio@arm.com>2019-09-20 17:04:24 +0000
commit4c268b97dff93eae3f71f2a6971f0d3f748b7b38 (patch)
tree4f3023105369f21a4df540db28f9b2c191a51534 /src/core/CL
parentc9564cb3850b6675cef663d7cc0722567b55cc25 (diff)
downloadComputeLibrary-4c268b97dff93eae3f71f2a6971f0d3f748b7b38.tar.gz
COMPMID-2681: Use NE/CL/Pad in NE/CL/GenerateProposalsLayer
Change-Id: Idf1c64224b0ddd4bdac1120cac4437eb2578bb2b Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com> Reviewed-on: https://review.mlplatform.org/c/1963 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Pablo Marquez <pablo.tello@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL')
-rw-r--r--src/core/CL/kernels/CLPadLayerKernel.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/core/CL/kernels/CLPadLayerKernel.cpp b/src/core/CL/kernels/CLPadLayerKernel.cpp
index 52b65c39b1..9dfd380f7c 100644
--- a/src/core/CL/kernels/CLPadLayerKernel.cpp
+++ b/src/core/CL/kernels/CLPadLayerKernel.cpp
@@ -24,6 +24,7 @@
#include "arm_compute/core/CL/kernels/CLPadLayerKernel.h"
#include "arm_compute/core/CL/CLHelpers.h"
+#include "arm_compute/core/utils/misc/ShapeCalculator.h"
namespace arm_compute
{
@@ -41,6 +42,10 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, c
std::pair<Status, Window> validate_and_configure_window(ITensorInfo *input, ITensorInfo *output, const PaddingList &padding, PixelValue constant_value, PaddingMode mode)
{
ARM_COMPUTE_UNUSED(constant_value, mode);
+ // Output auto initialization if not yet initialized
+ const TensorShape expected_output_shape = arm_compute::misc::shape_calculator::compute_padded_shape(input->tensor_shape(), padding);
+ auto_init_if_empty(*output, input->clone()->set_tensor_shape(expected_output_shape));
+
const unsigned int num_elems_processed_per_iteration = std::min(16U, 32U / static_cast<unsigned int>(element_size_from_data_type(input->data_type())));
// Configure kernel window
@@ -67,10 +72,8 @@ CLPadLayerKernel::CLPadLayerKernel()
void CLPadLayerKernel::configure(const ICLTensor *input, ICLTensor *output, const PaddingList &padding, PixelValue constant_value, PaddingMode mode)
{
+ // Perform validation step
ARM_COMPUTE_ERROR_ON_NULLPTR(input, output);
-
- // Output tensor auto initialisation if not yet initialized
- auto_init_if_empty(*output->info(), *input->info()->clone());
ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), output->info(), padding, constant_value, mode));
_input = input;
@@ -134,9 +137,9 @@ void CLPadLayerKernel::run(const Window &window, cl::CommandQueue &queue)
win_in.adjust(Window::DimX, _input_start_x, true);
win_in.adjust(Window::DimY, _input_start_y, true);
- Window slice_out = window.first_slice_window_3D();
- Window slice_in = win_in.first_slice_window_3D();
- unsigned int batch = 0;
+ Window slice_out = window.first_slice_window_3D();
+ Window slice_in = win_in.first_slice_window_3D();
+ unsigned int batch = 0;
do
{
unsigned int idx = 0;