Commits

Anonymous committed e15a374

new strategy for k in M4RI, seems to work well on Opteron and C2D

  • Participants
  • Parent commits e4b8389

Comments (0)

Files changed (1)

File src/brilliantrussian.c

 
   if (k == 0) {
     k = m4ri_opt_k(A->nrows, A->ncols, 0);
-    if (k>6) {
-      k -= 5;
-    } else if (k>5) {
-      k -= 4;
-    }
+    if (k>=7)
+      k = 7;
+    if ( (6*(1<<k)*A->ncols / 8.0) > CPU_L2_CACHE / 2.0 )
+      k -= 1;
+    if ( (6*(1<<k)*A->ncols / 8.0) > CPU_L2_CACHE / 2.0 )
+      k -= 1;
   }
   /*printf("k: %d\n",k);*/
   int kk = 6*k;