From c26179810823bb36375111f4a5485a6475fc97c5 Mon Sep 17 00:00:00 2001 From: Sang-Hoon Park Date: Wed, 20 May 2020 22:13:47 +0100 Subject: COMPMID-3363: Create ScaleKernelInfo NEScaleKernel and NEScale are modified to use the new kernel descriptor. Change-Id: I32e3e2a5209a38f5bf32c43f64b2aa4430825988 Signed-off-by: Sang-Hoon Park Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3239 Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas Comments-Addressed: Arm Jenkins --- arm_compute/core/KernelDescriptors.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'arm_compute/core/KernelDescriptors.h') diff --git a/arm_compute/core/KernelDescriptors.h b/arm_compute/core/KernelDescriptors.h index 6b4691bc83..de08288dec 100644 --- a/arm_compute/core/KernelDescriptors.h +++ b/arm_compute/core/KernelDescriptors.h @@ -24,6 +24,7 @@ #ifndef ARM_COMPUTE_CORE_KERNEL_DESCRIPTORS_H #define ARM_COMPUTE_CORE_KERNEL_DESCRIPTORS_H +#include "arm_compute/core/PixelValue.h" #include "arm_compute/core/Types.h" namespace arm_compute @@ -168,5 +169,39 @@ struct GEMMLowpReductionKernelInfo int32_t scalar{ 0 }; /**< Scalar value to multiply each reduced column/row by */ bool mul_by_scalar{ false }; /**< True if each column/row reduction has to be multiplied by a scalar value */ }; + +struct ScaleKernelInfo +{ + /** Constructor + * + * @param[in] interpolation_policy Interpolation type to use + * @param[in] border_mode Border mode policy + * @param[in] constant_border_value (Optional) Constant value to use for borders if border_mode is set to CONSTANT and use_padding is set to false. Defaults to default @ref PixelValue + * @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 with TOP_LEFT sampling policy. Defaults to false. + */ + ScaleKernelInfo(InterpolationPolicy interpolation_policy, + BorderMode border_mode, + PixelValue constant_border_value = PixelValue(), + SamplingPolicy sampling_policy = SamplingPolicy::CENTER, + bool use_padding = true, + bool align_corners = false) + : interpolation_policy{ interpolation_policy }, + border_mode{ border_mode }, + constant_border_value{ constant_border_value }, + sampling_policy{ sampling_policy }, + use_padding{ use_padding }, + align_corners{ align_corners } + { + } + + InterpolationPolicy interpolation_policy; /**< Interpolation type to use */ + BorderMode border_mode; /**< Border mode policy */ + PixelValue constant_border_value; /**< Constant value to use for constant border mode policy */ + SamplingPolicy sampling_policy; /**< Sampling policy used by the interpolation. */ + bool use_padding; /**< Indication of using padding */ + bool align_corners; /**< Align corners of input and output */ +}; } // namespace arm_compute #endif /* ARM_COMPUTE_CORE_KERNEL_DESCRIPTORS_H */ -- cgit v1.2.1