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

Ref #731
This commit is contained in:
Jerome Robert 2016-01-15 17:12:04 +01:00
parent 055b481386
commit 3ae30cd6b9
2 changed files with 10 additions and 3 deletions

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

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