Skip to content

Improve _gbmv for small data sizes #751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brada4 opened this issue Jan 23, 2016 · 1 comment
Closed

Improve _gbmv for small data sizes #751

brada4 opened this issue Jan 23, 2016 · 1 comment

Comments

@brada4
Copy link
Contributor

brada4 commented Jan 23, 2016

Dont start threads for small cases to avoid thread signaling latency and to not thrash cache of typical cpu core of today.

interface/gbmv.c

#ifdef SMP
   nthreads = num_cpu_avail(2);
+  if (trans) {
+    if(sizeof(FLOAT)*(lda*n+(m-1)*abs(incx)+(n-1)*abs(incy))<2*1024*1024) nthreads=1;
+  } else {
+    if(sizeof(FLOAT)*(lda*n+(n-1)*abs(incx)+(m-1)*abs(incy))<2*1024*1024) nthreads=1;
+  }

   if (nthreads == 1) {
 #endif
@brada4
Copy link
Contributor Author

brada4 commented Jan 27, 2016

Probably it is too hard if you have gift of GIT usage or your initials are $%, but if you look from the processors side at the memory it should clean those things up that it is not real32 around dynamically scaled frequencies, but about how far the next level cache goes and how much threads share that and so on and so on until we reach main memory, or run out of cores. Sorry for safe approximation for average case.

@brada4 brada4 closed this as completed Jan 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant