From 5b7fd87b6ab73a7206a45d3621d484131c901143 Mon Sep 17 00:00:00 2001 From: Sang-Hoon Park Date: Thu, 9 Jan 2020 15:27:51 +0000 Subject: MLCE-139 add align_corners parameter handling to CLScale Change-Id: I9d6047c306d7928258d5168eb4bfb96b09d2608f Signed-off-by: Sang-Hoon Park Reviewed-on: https://review.mlplatform.org/c/2569 Reviewed-by: Pablo Marquez Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- arm_compute/core/CL/kernels/CLScaleKernel.h | 8 ++++++-- arm_compute/runtime/CL/functions/CLScale.h | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'arm_compute') diff --git a/arm_compute/core/CL/kernels/CLScaleKernel.h b/arm_compute/core/CL/kernels/CLScaleKernel.h index 7d9ed41305..f93286b07d 100644 --- a/arm_compute/core/CL/kernels/CLScaleKernel.h +++ b/arm_compute/core/CL/kernels/CLScaleKernel.h @@ -43,8 +43,9 @@ public: * @param[in] policy Interpolation type to use * @param[in] border_mode Selected border mode. * @param[in] sampling_policy (Optional) Sampling policy used by the interpolation. Defaults to @ref SamplingPolicy::CENTER + * @param[in] align_corners (Optional) Align corners of input and output, only affecting bilinear policy with TOP_LEFT sampling policy. Defaults to false. */ - void configure(const ICLTensor *input, ICLTensor *output, InterpolationPolicy policy, BorderMode border_mode, SamplingPolicy sampling_policy = SamplingPolicy::CENTER); + void configure(const ICLTensor *input, ICLTensor *output, InterpolationPolicy policy, BorderMode border_mode, SamplingPolicy sampling_policy = SamplingPolicy::CENTER, bool align_corners = false); /** Static function to check if given info will lead to a valid configuration of @ref CLScaleKernel * @@ -54,10 +55,12 @@ public: * @param[in] policy Interpolation type to use * @param[in] border_mode Selected border mode. * @param[in] sampling_policy (Optional) Sampling policy used by the interpolation. Defaults to @ref SamplingPolicy::CENTER + * @param[in] align_corners (Optional) Align corners of input and output, only affecting bilinear policy with TOP_LEFT sampling policy. Defaults to false. * * @return a status */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, InterpolationPolicy policy, BorderMode border_mode, SamplingPolicy sampling_policy = SamplingPolicy::CENTER); + static Status validate(const ITensorInfo *input, const ITensorInfo *output, InterpolationPolicy policy, BorderMode border_mode, SamplingPolicy sampling_policy = SamplingPolicy::CENTER, + bool align_corners = false); /** Input tensor accessor. * * @return Pointer to input tensor. @@ -76,6 +79,7 @@ public: public: InterpolationPolicy _interpolationPolicy = InterpolationPolicy::BILINEAR; DataLayout _data_layout = DataLayout::UNKNOWN; + bool _align_corners = false; }; } // namespace arm_compute #endif /*ARM_COMPUTE_CLSCALEKERNEL_H */ diff --git a/arm_compute/runtime/CL/functions/CLScale.h b/arm_compute/runtime/CL/functions/CLScale.h index 9a201dc10f..c06c9b629a 100644 --- a/arm_compute/runtime/CL/functions/CLScale.h +++ b/arm_compute/runtime/CL/functions/CLScale.h @@ -47,7 +47,7 @@ public: * @param[in] constant_border_value (Optional) Constant value to use for borders if border_mode is set to CONSTANT. * @param[in] sampling_policy (Optional) Sampling policy used by the interpolation. Defaults to @ref SamplingPolicy::CENTER * @param[in] use_padding (Optional) Is padding in use or not. Defaults to true. - * @param[in] align_corners (Optional) Align corners of input and output, only affecting bilinear policy. Defaults to false. + * @param[in] align_corners (Optional) Align corners of input and output, only affecting bilinear policy with TOP_LEFT sampling policy. Defaults to false. */ void configure(ICLTensor *input, ICLTensor *output, InterpolationPolicy policy, BorderMode border_mode, PixelValue constant_border_value = PixelValue(), SamplingPolicy sampling_policy = SamplingPolicy::CENTER, bool use_padding = true, bool align_corners = false); @@ -62,7 +62,7 @@ public: * @param[in] constant_border_value (Optional) Constant value to use for borders if border_mode is set to CONSTANT. * @param[in] sampling_policy (Optional) Sampling policy used by the interpolation. Defaults to @ref SamplingPolicy::CENTER * @param[in] use_padding (Optional) Is padding in use or not. Defaults to true. - * @param[in] align_corners (Optional) Align corners of input and output, only affecting bilinear policy. Defaults to false. + * @param[in] align_corners (Optional) Align corners of input and output, only affecting bilinear policy with TOP_LEFT sampling policy. Defaults to false. * * @return a status */ -- cgit v1.2.1