projects
/
platform
/
upstream
/
openblas.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b985cea
)
adjust number of threads for small size in cgemv and zgemv
author
wernsaar
<wernsaar@googlemail.com>
Tue, 15 Jul 2014 14:27:02 +0000
(16:27 +0200)
committer
wernsaar
<wernsaar@googlemail.com>
Tue, 15 Jul 2014 14:27:02 +0000
(16:27 +0200)
interface/zgemv.c
patch
|
blob
|
history
diff --git
a/interface/zgemv.c
b/interface/zgemv.c
index fcc2fda54b8ef9ba9ce4e047cedc53b6ca40c45b..50513a8e47a29d023e38d1d9953255d6d5dd60e8 100644
(file)
--- a/
interface/zgemv.c
+++ b/
interface/zgemv.c
@@
-233,7
+233,19
@@
void CNAME(enum CBLAS_ORDER order,
buffer = (FLOAT *)blas_memory_alloc(1);
#ifdef SMP
- nthreads = num_cpu_avail(2);
+
+ int nthreads_max = num_cpu_avail(2);
+ int nthreads_avail = nthreads_max;
+
+ double MNK = (double) m * (double) n;
+ if ( MNK <= (80.0 * 20.0 * (double) GEMM_MULTITHREAD_THRESHOLD) )
+ nthreads_max = 1;
+
+ if ( nthreads_max > nthreads_avail )
+ nthreads = nthreads_avail;
+ else
+ nthreads = nthreads_max;
+
if (nthreads == 1) {
#endif