On Thursday 15 May 2008, Bill Hart wrote:
> Hi Martin,
>
> Here is a run that illustrates the problem. Am I doing something
> wrong?

No, I was stupid. The cpucycles are printed as %u but they should be printed 
as %llu since they are longer than an int. I've attached the fixed C file 
(since it is < 1KB).

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_www: http://www.informatik.uni-bremen.de/~malb
_jab: [EMAIL PROTECTED]


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

#include <stdlib.h>
#include "cpucycles.h"
#include "m4ri.h"

int main(int argc, char **argv) {
  int n, cutoff;
  unsigned long long t;
  m4ri_build_all_codes();

  if (argc != 3) {
    m4ri_die("Parameters n and cutoff expected.\n");
  }
  n = atoi(argv[1]);
  cutoff = atoi(argv[2]);

  if (n<=0) {
    m4ri_die("Parameter n must be > 0\n");
  }

  if (cutoff<=0) {
    m4ri_die("Parameter cutoff must be > 0\n");
  }

  packedmatrix *A = mzd_init(n, n);
  packedmatrix *B = mzd_init(n, n);
  mzd_randomize(A);
  mzd_randomize(B);

  t = cpucycles();
  packedmatrix *C = mzd_mul_strassen(NULL, A, B, cutoff);
  printf("n: %5d, cutoff: %5d, cpu cycles: %llu\n",n, cutoff, cpucycles() - t);

  mzd_free(A);
  mzd_free(B);
  mzd_free(C);
  m4ri_destroy_all_codes();
}

Reply via email to