From 7317e393de848cb20dd326a45a9efb18a3ee7701 Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Fri, 17 Jan 2020 11:27:49 +0000 Subject: COMPMID-2941 Add QAsymm8 and S32 support for ArgMinMax to CL Select operation does not work with any combination of datatypes. Added a new OpenCL build option, DATA_TYPE_SELECT, in oder to specify the select result. Change-Id: I5c73c2a6b1d121288b7f6edba3e0cb1104636844 Signed-off-by: Michalis Spyrou Reviewed-on: https://review.mlplatform.org/c/2601 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio --- src/core/CL/cl_kernels/reduction_operation.cl | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/core/CL/cl_kernels/reduction_operation.cl') diff --git a/src/core/CL/cl_kernels/reduction_operation.cl b/src/core/CL/cl_kernels/reduction_operation.cl index 451b962b01..79d0d0683e 100644 --- a/src/core/CL/cl_kernels/reduction_operation.cl +++ b/src/core/CL/cl_kernels/reduction_operation.cl @@ -23,6 +23,19 @@ */ #include "helpers.h" +#if defined(FLOAT_DATA_TYPE) +#define ISGREATER(x, y) isgreater(x, y) +#define ISLESS(x, y) isless(x, y) +#else // !FLOAT_DATA_TYPE +#if defined(WIDTH) +#define ISGREATER(x, y) (x > y) ? 1 : 0 +#define ISLESS(x, y) (x < y) ? 1 : 0 +#else // !defined(WIDTH) +#define ISGREATER(x, y) select(int16)0, int16) - 1, x > y) +#define ISLESS(x, y) select(int16)0, int16) - 1, x < y) +#endif // defined(WIDTH) +#endif // defined(FLOAT_DATA_TYPE) + /** Calculate square sum of a vector * * @param[in] input Pointer to the first pixel. -- cgit v1.2.1