aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core
diff options
context:
space:
mode:
authorManuel Bottini <manuel.bottini@arm.com>2019-06-17 12:04:40 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2019-07-11 16:14:01 +0000
commitc1b76faf6be5c33dbf3269faea95e185ac37992f (patch)
treec52ecf022bf8b5e54844258744e6a10619b68d83 /arm_compute/core
parent0ec65b8c6438b6d12f17487fdc4c870fe37c7caa (diff)
downloadComputeLibrary-c1b76faf6be5c33dbf3269faea95e185ac37992f.tar.gz
COMPMID-2092: Refactoring interface for the deconvolution kernels (NEON/CL)
3RDPARTY_UPDATE Change-Id: Id7ddf97e2c9ceb2cb84084fab2c6f5697890c193 Signed-off-by: giuros01 <giuseppe.rossini@arm.com> Reviewed-on: https://review.mlplatform.org/c/1424 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'arm_compute/core')
-rw-r--r--arm_compute/core/CL/kernels/CLDeconvolutionLayerUpsampleKernel.h21
-rw-r--r--arm_compute/core/CPP/kernels/CPPUpsampleKernel.h11
-rw-r--r--arm_compute/core/utils/misc/ShapeCalculator.h23
3 files changed, 23 insertions, 32 deletions
diff --git a/arm_compute/core/CL/kernels/CLDeconvolutionLayerUpsampleKernel.h b/arm_compute/core/CL/kernels/CLDeconvolutionLayerUpsampleKernel.h
index 5ccf4e64ed..21d026e0a1 100644
--- a/arm_compute/core/CL/kernels/CLDeconvolutionLayerUpsampleKernel.h
+++ b/arm_compute/core/CL/kernels/CLDeconvolutionLayerUpsampleKernel.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -50,22 +50,20 @@ public:
/** Initialise the kernel's input and output.
*
- * @param[in] input Source tensor. Data types supported: QASYMM8/F16/F32.
- * @param[out] output Destination tensor. Data types supported: same as @p input. All but the lowest two dimensions must be the same size as in the input tensor, i.e. scaling is only performed within the XY-plane.
- * @param[in] inner_border Top and right inner border sizes. These rows and columns will be filled with zero.
- * @param[in] info Contains padding and stride information described in @ref PadStrideInfo.
+ * @param[in] input Source tensor. Data types supported: QASYMM8/F16/F32.
+ * @param[out] output Destination tensor. Data types supported: same as @p input. All but the lowest two dimensions must be the same size as in the input tensor, i.e. scaling is only performed within the XY-plane.
+ * @param[in] info Contains padding and stride information described in @ref PadStrideInfo.
*/
- void configure(const ICLTensor *input, ICLTensor *output, const BorderSize &inner_border, const PadStrideInfo &info);
+ void configure(const ICLTensor *input, ICLTensor *output, const PadStrideInfo &info);
/** Static function to check if given info will lead to a valid configuration of @ref CLDeconvolutionLayerUpsample
*
- * @param[in] input Source tensor info. Data types supported: QASYMM8/F16/F32.
- * @param[in] output Destination tensor info. Data types supported: same as @p input. All but the lowest two dimensions must be the same size as in the input tensor, i.e. scaling is only performed within the XY-plane.
- * @param[in] inner_border Top and right inner border sizes. These rows and columns will be filled with zero.
- * @param[in] info Contains padding and stride information described in @ref PadStrideInfo.
+ * @param[in] input Source tensor info. Data types supported: QASYMM8/F16/F32.
+ * @param[in] output Destination tensor info. Data types supported: same as @p input. All but the lowest two dimensions must be the same size as in the input tensor, i.e. scaling is only performed within the XY-plane.
+ * @param[in] info Contains padding and stride information described in @ref PadStrideInfo.
*
* @return a status
*/
- static Status validate(const ITensorInfo *input, const ITensorInfo *output, const BorderSize &inner_border, const PadStrideInfo &info);
+ static Status validate(const ITensorInfo *input, const ITensorInfo *output, const PadStrideInfo &info);
// Inherited methods overridden:
void run(const Window &window, cl::CommandQueue &queue) override;
@@ -73,7 +71,6 @@ public:
private:
const ICLTensor *_input;
ICLTensor *_output;
- BorderSize _inner_border;
PadStrideInfo _info;
};
} // namespace arm_compute
diff --git a/arm_compute/core/CPP/kernels/CPPUpsampleKernel.h b/arm_compute/core/CPP/kernels/CPPUpsampleKernel.h
index fedbb54d35..571debe1b3 100644
--- a/arm_compute/core/CPP/kernels/CPPUpsampleKernel.h
+++ b/arm_compute/core/CPP/kernels/CPPUpsampleKernel.h
@@ -55,13 +55,11 @@ public:
/** Set the input and output of the kernel.
*
- * @param[in] input The input tensor to upsample. Data types supported: F32/F16/QASYMM8
- * @param[out] output The output tensor. Data types supported: Same as @p input
- * @param[in] info Padding info.
- * @param[in] inner_border_right The number of zeros added to right edge of the input.
- * @param[in] inner_border_top The number of zeros added to top edge of the input.
+ * @param[in] input The input tensor to upsample. Data types supported: F32/F16/QASYMM8
+ * @param[out] output The output tensor. Data types supported: Same as @p input
+ * @param[in] info Padding info.
*/
- void configure(const ITensor *input, ITensor *output, const PadStrideInfo &info, unsigned int inner_border_right, unsigned int inner_border_top);
+ void configure(const ITensor *input, ITensor *output, const PadStrideInfo &info);
// Inherited methods overridden:
void run(const Window &window, const ThreadInfo &info) override;
@@ -71,7 +69,6 @@ private:
const ITensor *_input;
ITensor *_output;
PadStrideInfo _info;
- std::pair<unsigned int, unsigned int> _inner_border;
};
} // namespace arm_compute
#endif /*__ARM_COMPUTE_CPPUPSAMPLEKERNEL_H__ */
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h
index 010501454f..65a2a1edf4 100644
--- a/arm_compute/core/utils/misc/ShapeCalculator.h
+++ b/arm_compute/core/utils/misc/ShapeCalculator.h
@@ -438,20 +438,17 @@ inline TensorShape compute_depthwise_convolution_shape(const ITensorInfo &input,
/** Calculate the upsampled output shape used for deconvolution
*
- * @param[in] input Input tensor info
- * @param[in] weights Weights tensor shape
- * @param[in] sx Stride on x axis
- * @param[in] sy Stride on y axis
- * @param[in] inner_border_right The number of zeros added to right edge of the input.
- * @param[in] inner_border_top The number of zeros added to top edge of the input.
- * @param[in] out_dims Output shape dimensions
- * @param[in] padx Padding on x axis
- * @param[in] pady Padding on y axis
+ * @param[in] input Input tensor info
+ * @param[in] weights Weights tensor shape
+ * @param[in] sx Stride on x axis
+ * @param[in] sy Stride on y axis
+ * @param[in] out_dims Output shape dimensions
+ * @param[in] padx Padding on x axis
+ * @param[in] pady Padding on y axis
*
* @return the calculated shape
*/
-inline TensorShape compute_deconvolution_upsampled_shape(const ITensorInfo &input, const ITensorInfo &weights, unsigned int sx, unsigned int sy, unsigned int inner_border_right,
- unsigned int inner_border_top,
+inline TensorShape compute_deconvolution_upsampled_shape(const ITensorInfo &input, const ITensorInfo &weights, unsigned int sx, unsigned int sy,
std::pair<unsigned int, unsigned int> &out_dims, unsigned int &padx, unsigned int &pady)
{
const DataLayout data_layout = input.data_layout();
@@ -459,8 +456,8 @@ inline TensorShape compute_deconvolution_upsampled_shape(const ITensorInfo &inpu
const size_t idx_h = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT);
// Find the upsampled dimensions
- unsigned int out_x = (input.dimension(idx_w) - 1) * sx + inner_border_right + 1;
- unsigned int out_y = (input.dimension(idx_h) - 1) * sy + inner_border_top + 1;
+ unsigned int out_x = (input.dimension(idx_w) - 1) * sx + 1;
+ unsigned int out_y = (input.dimension(idx_h) - 1) * sy + 1;
// Find the padding needed for the convolution with stride 1 in order to match output shape
padx = out_dims.first - (out_x - weights.dimension(idx_w) + 1);