aboutsummaryrefslogtreecommitdiff
path: root/src/core/NEON/kernels/NEReorgLayerKernel.cpp
diff options
context:
space:
mode:
authorGian Marco Iodice <gianmarco.iodice@arm.com>2018-08-21 17:53:38 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:54:54 +0000
commit477531c258801caf3cce44eb3e43df611b42fc6d (patch)
tree824294059aa01b658e80c760a5fb0773341add4f /src/core/NEON/kernels/NEReorgLayerKernel.cpp
parent4854fc3d9cac1de37e4670bc4272f44b43be8fa3 (diff)
downloadComputeLibrary-477531c258801caf3cce44eb3e43df611b42fc6d.tar.gz
COMPMID-1527 - Implementing ReorgLayer on OpenCL
Also extended tests on NEON Change-Id: Icb0eced534e904ef807972dd3a31988f501bb02e Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/147095 Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/NEON/kernels/NEReorgLayerKernel.cpp')
-rw-r--r--src/core/NEON/kernels/NEReorgLayerKernel.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/core/NEON/kernels/NEReorgLayerKernel.cpp b/src/core/NEON/kernels/NEReorgLayerKernel.cpp
index 1b2ec92cba..8baea2b990 100644
--- a/src/core/NEON/kernels/NEReorgLayerKernel.cpp
+++ b/src/core/NEON/kernels/NEReorgLayerKernel.cpp
@@ -46,14 +46,20 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, i
DataType::U16, DataType::S16,
DataType::U32, DataType::S32,
DataType::F16, DataType::F32);
- ARM_COMPUTE_RETURN_ERROR_ON_MSG(stride <= 0, "Stride should be a positive number");
+ ARM_COMPUTE_RETURN_ERROR_ON(input->data_layout() == DataLayout::UNKNOWN);
- const TensorShape output_shape = misc::shape_calculator::compute_reorg_output_shape(*input, stride);
+ const size_t idx_width = get_data_layout_dimension_index(input->data_layout(), DataLayoutDimension::WIDTH);
+ const size_t idx_height = get_data_layout_dimension_index(input->data_layout(), DataLayoutDimension::HEIGHT);
- // Validate configured output
+ ARM_COMPUTE_RETURN_ERROR_ON(stride <= 0);
+ ARM_COMPUTE_RETURN_ERROR_ON_MSG((input->tensor_shape()[idx_width] % stride) != 0, "The width of the input tensor must be a multiple of stride");
+ ARM_COMPUTE_RETURN_ERROR_ON_MSG((input->tensor_shape()[idx_height] % stride) != 0, "The height of the input tensor must be a multiple of stride");
+
+ // Validate output if initialized
if(output->total_size() != 0)
{
- ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(output->tensor_shape(), output_shape);
+ const TensorInfo tensor_info_output = output->clone()->set_tensor_shape(misc::shape_calculator::compute_reorg_output_shape(*input, stride));
+ ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(output, &tensor_info_output);
ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, output);
}