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:
3ae30cd
)
swap: disable multi-threading for small matrices
author
Jerome Robert
<jeromerobert@gmx.com>
Mon, 18 Jan 2016 08:12:37 +0000
(09:12 +0100)
committer
Jerome Robert
<jeromerobert@gmx.com>
Tue, 19 Jan 2016 16:14:46 +0000
(17:14 +0100)
Close #731
interface/swap.c
patch
|
blob
|
history
diff --git
a/interface/swap.c
b/interface/swap.c
index
3baeb27
..
23b2e4e
100644
(file)
--- a/
interface/swap.c
+++ b/
interface/swap.c
@@
-77,12
+77,13
@@
void CNAME(blasint n, FLOAT *x, blasint incx, FLOAT *y, blasint incy){
if (incy < 0) y -= (n - 1) * incy;
#ifdef SMP
- nthreads = num_cpu_avail(1);
//disable multi-thread when incx==0 or incy==0
//In that case, the threads would be dependent.
- if (incx == 0 || incy == 0)
- nthreads = 1;
+ if (incx == 0 || incy == 0 || n < 2097152 * GEMM_MULTITHREAD_THRESHOLD / sizeof(FLOAT))
+ nthreads = 1;
+ else
+ nthreads = num_cpu_avail(1);
if (nthreads == 1) {
#endif