Skip to content
Snippets Groups Projects
Commit dc2d61eb authored by carlocamilloni's avatar carlocamilloni
Browse files

OpenMP: fix for getGoodNumThread

@giovannibussi right?
parent 3bf96924
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,7 @@ unsigned OpenMP::getGoodNumThreads(const T*x,unsigned n) {
(void) p; // this is not to have warnings. notice that the pointer location is not used actually.
// a factor two is necessary since there is no guarantee that x is aligned
// to cache line boundary
unsigned m=n/(2*getCachelineSize()*sizeof(T));
unsigned m=n*sizeof(T)/(2*getCachelineSize());
unsigned numThreads=getNumThreads();
if(m>numThreads) m=numThreads;
if(m==0) m=1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment