POWER10: Fix multithreading check when USE_THREAD=0
authorVFerrari <vferrari@mpc.com.br>
Sat, 25 Jun 2022 06:21:18 +0000 (03:21 -0300)
committerVFerrari <vferrari@mpc.com.br>
Sat, 25 Jun 2022 06:46:46 +0000 (03:46 -0300)
This patch fixes an issue when OpenBLAS is compiled for TARGET=POWER10
and the flag USE_THREAD is set to 0.

The function `num_cpu_avail` is only available when USE_THREAD=1,
so SMP is defined.

kernel/power/gemm_small_kernel_permit_power10.c

index 9b38e45..3a146d8 100644 (file)
@@ -69,6 +69,7 @@ int CNAME(int transa, int transb, BLASLONG M, BLASLONG N, BLASLONG K, FLOAT alph
 
 #endif
 
+#ifdef SMP
   // Multi-threading execution outperforms (or approaches) the execution of the
   // small kernel.
   if (num_cpu_avail(3) > 1) {
@@ -77,6 +78,9 @@ int CNAME(int transa, int transb, BLASLONG M, BLASLONG N, BLASLONG K, FLOAT alph
   } else {
     return 1;
   }
+#else
+  return 1;
+#endif
 
 #endif