Fix CL Compiler frontend failure for ArgMinMax
authorGiorgio Arena <giorgio.arena@arm.com>
Wed, 3 Feb 2021 12:29:57 +0000 (12:29 +0000)
committerGiorgio Arena <giorgio.arena@arm.com>
Thu, 4 Feb 2021 15:30:33 +0000 (15:30 +0000)
- Change select condition's data type to satisfy its signature
- Add failing test case with VEC_SIZE == 1

Resolve: COMPMID-4110

Change-Id: I52287bff7a2108f92fd12164e267df6c074d5508
Signed-off-by: Giorgio Arena <giorgio.arena@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4978
Reviewed-by: TeresaARM <teresa.charlinreyes@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
src/core/CL/cl_kernels/arg_min_max.cl
tests/validation/CL/ArgMinMax.cpp

index 6ef0a61ac5b045d8474dc6ff7af33f8f328340b6..6e57ed0af1f4dbf5153cb9325a12e18c970041c1 100644 (file)
@@ -38,8 +38,8 @@
 #define ISGREATER(x, y) (x > y) ? 1 : 0
 #define ISLESS(x, y) (x < y) ? 1 : 0
 #else // !defined(WIDTH)
-#define ISGREATER(x, y) select((VEC_SIGNED_INT_IN)0, (VEC_SIGNED_INT_IN)-1, x > y)
-#define ISLESS(x, y) select((VEC_SIGNED_INT_IN)0, (VEC_SIGNED_INT_IN)-1, x < y)
+#define ISGREATER(x, y) select((VEC_SIGNED_INT_IN)0, (VEC_SIGNED_INT_IN)-1, (VEC_SIGNED_INT_IN)(x > y))
+#define ISLESS(x, y) select((VEC_SIGNED_INT_IN)0, (VEC_SIGNED_INT_IN)-1, (VEC_SIGNED_INT_IN)(x < y))
 #endif // defined(WIDTH)
 #endif // defined(FLOAT_DATA_TYPE)
 
@@ -342,7 +342,7 @@ __kernel void arg_min_max_y(
 }
 #endif // defined(HEIGHT)
 
-#if defined(DEPTH)
+#if defined(DEPTH) && !defined(BATCH)
 /** This kernel performs reduction on z-axis.
  *
  * @note The data type must be passed at compile time using -DDATA_TYPE: e.g. -DDATA_TYPE=float
@@ -390,7 +390,7 @@ __kernel void arg_min_max_z(
     // Store result
     STORE_VECTOR_SELECT(indx, DATA_TYPE_OUTPUT, output_addr, VEC_SIZE, VEC_SIZE_LEFTOVER, VEC_SIZE_LEFTOVER != 0 && get_global_id(0) == 0);
 }
-#endif /* defined(DEPTH) */
+#endif /* defined(DEPTH)  && !defined(BATCH) */
 
 #if defined(BATCH) && defined(DEPTH)
 /** This kernel performs reduction on w-axis.
index 2508c63524f19d1af2daf1a523e48362d7c9403c..1d849ed0c7a7168ff9ad364da69d468953d5275f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018-2020 Arm Limited.
+ * Copyright (c) 2018-2021 Arm Limited.
  *
  * SPDX-License-Identifier: MIT
  *
@@ -45,7 +45,7 @@ namespace
 {
 const auto ArgMinMaxSmallDataset = framework::dataset::make("Shape",
 {
-    TensorShape{ 2U, 7U, 1U, 3U },
+    TensorShape{ 1U, 7U, 1U, 3U },
     TensorShape{ 149U, 5U, 1U, 2U },
     TensorShape{ 166U, 5U, 1U, 2U },
     TensorShape{ 322U, 5U, 1U, 2U },