Skip to content

Commit 6f32991

Browse files
committed
Don't define the mode variable when not needed in gemm functions
1 parent 202fc9e commit 6f32991

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

interface/gemm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANS
246246

247247
#ifdef SMP
248248
double MNK;
249+
#if defined(USE_SIMPLE_THREADED_LEVEL3) || !defined(NO_AFFINITY)
249250
#ifndef COMPLEX
250251
#ifdef XDOUBLE
251252
int mode = BLAS_XDOUBLE | BLAS_REAL;
@@ -264,6 +265,7 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANS
264265
#endif
265266
#endif
266267
#endif
268+
#endif
267269

268270
#if defined(SMP) && !defined(NO_AFFINITY) && !defined(USE_SIMPLE_THREADED_LEVEL3)
269271
int nodes;
@@ -417,8 +419,10 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANS
417419
sb = (XFLOAT *)(((BLASLONG)sa + ((GEMM_P * GEMM_Q * COMPSIZE * SIZE + GEMM_ALIGN) & ~GEMM_ALIGN)) + GEMM_OFFSET_B);
418420

419421
#ifdef SMP
422+
#if defined(USE_SIMPLE_THREADED_LEVEL3) || !defined(NO_AFFINITY)
420423
mode |= (transa << BLAS_TRANSA_SHIFT);
421424
mode |= (transb << BLAS_TRANSB_SHIFT);
425+
#endif
422426

423427
MNK = (double) args.m * (double) args.n * (double) args.k;
424428
if ( MNK <= (SMP_THRESHOLD_MIN * (double) GEMM_MULTITHREAD_THRESHOLD) )

0 commit comments

Comments
 (0)