Commits

Anonymous committed 7b8d6f8

use L2_CACHE_SIZE for PLUQ cutoff (experimental)

Comments (0)

Files changed (6)

   size_t nrows = A->nrows;
 #endif
 
-  /*if (A->width*A->nrows <= CPU_L2_CACHE>>3) { */
-  if(ncols <= PLUQ_CUTOFF) {
+  if (ncols <= RADIX || A->width*A->nrows <= CPU_L2_CACHE>>3) {
+/*   if(ncols <= PLUQ_CUTOFF) { */
     /* this improves data locality and runtime considerably */
     mzd_t *Abar = mzd_copy(NULL, A);
     size_t r = _mzd_lqup_mmpf(Abar, P, Q, 0);
 #include "misc.h"
 #include "packedmatrix.h"
 
-/**
- * Crossover point for PLUQ factorization.
- */
+/* /\** */
+/*  * Crossover point for PLUQ factorization. */
+/*  *\/ */
 
-#define PLUQ_CUTOFF 2048
+/* #define PLUQ_CUTOFF 2048 */
 
 /**
  * \brief PLUQ matrix decomposition.
 /**
  * \brief Enable memory block cache (default: disabled)
  */
-//#define ENABLE_MMC
+#define ENABLE_MMC
 
 
 /**
 
 static inline void *m4ri_mmc_calloc(size_t size, size_t count) {
   void *ret = m4ri_mmc_malloc(size*count);
-  memset(ret, 0, count*size);
+  memset((char*)ret, 0, count*size);
   return ret;
 }
 

src/packedmatrix.c

   window->blocks = NULL;
 
   if(nrows)
-    window->rows = (word **)m4ri_mmc_malloc( nrows * sizeof(word*));
+    window->rows = (word **)m4ri_mmc_calloc(sizeof(word*), nrows+1);
   else
     window->rows = NULL;
 

src/permutation.c

  * Implements both apply_p_right and apply_p_right_trans.
  */
 void _mzd_apply_p_right_even(mzd_t *A, mzp_t *P, size_t start_row, size_t start_col, int notrans) {
-  assert(A->offset = 0);
+  assert(A->offset == 0);
   if(A->nrows - start_row == 0)
     return;
   const size_t length = MIN(P->length,A->ncols);

testsuite/test_kernel.c

   mzd_t* A = mzd_init(m, n);
   mzd_randomize(A);
   
-  size_t i,j;
-
   mzd_t *Acopy = mzd_copy(NULL, A);
 
   size_t r = mzd_echelonize_m4ri(A, 0, 0);