From e222941f931b1d44bb29e5827b6df748e60cefc4 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 12 Jul 2017 12:30:40 +0100 Subject: COMPMID-401: Implement FixedPointPosition conversion for NEON. Adds support of changing the fixed point position of a tensor in DepthConvert. Change-Id: Ic3b50a4628fac7497a0217d92941c9d6f64d21cb Reviewed-on: http://mpd-gerrit.cambridge.arm.com/80438 Reviewed-by: Anthony Barbier Tested-by: Kaizen --- .../core/NEON/kernels/NEDepthConvertKernel.h | 33 ++++++++++++++++------ 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'arm_compute/core/NEON') diff --git a/arm_compute/core/NEON/kernels/NEDepthConvertKernel.h b/arm_compute/core/NEON/kernels/NEDepthConvertKernel.h index 0c5c29e4db..ad8d152bbf 100644 --- a/arm_compute/core/NEON/kernels/NEDepthConvertKernel.h +++ b/arm_compute/core/NEON/kernels/NEDepthConvertKernel.h @@ -24,7 +24,7 @@ #ifndef __ARM_COMPUTE_DEPTHCONVERTKERNEL_H__ #define __ARM_COMPUTE_DEPTHCONVERTKERNEL_H__ -#include "arm_compute/core/NEON/INESimpleKernel.h" +#include "arm_compute/core/NEON/INEKernel.h" #include "arm_compute/core/Types.h" #include @@ -34,35 +34,52 @@ namespace arm_compute class ITensor; /** Depth conversion kernel */ -class NEDepthConvertKernel : public INESimpleKernel +class NEDepthConvertKernel : public INEKernel { public: /** Default constructor*/ NEDepthConvertKernel(); + /** Prevent instances of this class from being copied (As this class contains pointers) */ + NEDepthConvertKernel(const NEDepthConvertKernel &) = delete; + /** Default move constructor */ + NEDepthConvertKernel(NEDepthConvertKernel &&) = default; + /** Prevent instances of this class from being copied (As this class contains pointers) */ + NEDepthConvertKernel &operator=(const NEDepthConvertKernel &) = delete; + /** Default move assignment operator */ + NEDepthConvertKernel &operator=(NEDepthConvertKernel &&) = default; /** Set the input and output of the kernel * * Valid conversions Input -> Output : * - * - QS8 -> F32 + * - QS8 -> QS8, F32 * - U8 -> U16, S16, S32 * - U16 -> U8, U32 * - S16 -> U8, S32 + * - QS16 -> QS16, F32 * - F32 -> QS8 * + * @warning In case of in-place fixed point position conversion make sure that configure has been called + * before the updated tensor is used in other functions, as the TensorInfo of the tensor will be + * altered. In-place is only supported for QS8 -> QS8, QS16 -> QS16. * - * @param[in] input The input tensor to convert. Data types supported: U8/QS8/U16/S16/F32. - * @param[out] output The output tensor. Data types supported: U8/QS8/U16/S16/U32/S32/F32. - * @param[in] policy Conversion policy. - * @param[in] shift Value for down/up conversions. Must be 0 <= shift < 8. + * @param[in, out] input The input tensor to convert (Written in case of in-place computation). Data types supported: U8/QS8/U16/S16/F32. + * @param[out] output The output tensor. Can be null in case of in-place computation. Data types supported: U8/QS8/U16/S16/U32/S32/F32. + * @param[in] policy Conversion policy. + * @param[in] shift (Optional) Value for down/up conversions. Must be 0 <= shift < 8. + * In case of fixed point position conversion, it specifies the new fixed point position, if operation is in-place. */ - void configure(const ITensor *input, ITensor *output, ConvertPolicy policy, uint32_t shift); + void configure(ITensor *input, ITensor *output, ConvertPolicy policy, uint32_t shift = 0); // Inherited methods overridden: void run(const Window &window) override; private: + ITensor *_input; + ITensor *_output; ConvertPolicy _policy; uint32_t _shift; + int _fixed_point_position_input; + int _fixed_point_position_output; }; } #endif /*__ARM_COMPUTE_NEDEPTHCONVERTKERNEL_H__ */ -- cgit v1.2.1