Browse Source

Disable multi-threading for small matrices in [z]ger

Ref #731
tags/v0.2.16.rc1
Jerome Robert 9 years ago
parent
commit
3ae30cd6b9
2 changed files with 10 additions and 3 deletions
  1. +5
    -2
      interface/ger.c
  2. +5
    -1
      interface/zger.c

+ 5
- 2
interface/ger.c View File

@@ -174,8 +174,11 @@ void CNAME(enum CBLAS_ORDER order,
STACK_ALLOC(m, FLOAT, buffer);

#ifdef SMPTEST
nthreads = num_cpu_avail(2);

// Threshold chosen so that speed-up is > 1 on a Xeon E5-2630
if(1L * m * n > 24L * GEMM_MULTITHREAD_THRESHOLD)
nthreads = num_cpu_avail(2);
else
nthreads = 1;

if (nthreads == 1) {
#endif


+ 5
- 1
interface/zger.c View File

@@ -213,7 +213,11 @@ void CNAME(enum CBLAS_ORDER order,
buffer = (FLOAT *)blas_memory_alloc(1);

#ifdef SMPTEST
nthreads = num_cpu_avail(2);
// Threshold chosen so that speed-up is > 1 on a Xeon E5-2630
if(1L * m * n > 3L * sizeof(FLOAT) * GEMM_MULTITHREAD_THRESHOLD)
nthreads = num_cpu_avail(2);
else
nthreads = 1;

if (nthreads == 1) {
#endif


Loading…
Cancel
Save