1 /* chrono - demo of GRAS benchmarking features */
3 /* Copyright (c) 2005 Martin Quinson, Arnaud Legrand. All rights reserved. */
5 /* This program is free software; you can redistribute it and/or modify it
6 * under the terms of the license (GNU LGPL) which comes with this package. */
11 XBT_LOG_NEW_DEFAULT_CATEGORY(Chrono,"Messages specific to this example");
14 void cblas_dgemm(const enum CBLAS_ORDER Order,
15 const enum CBLAS_TRANSPOSE TransA,
16 const enum CBLAS_TRANSPOSE TransB, const int M,
17 const int N, const int K, const double alpha,
18 const double *A, const int lda, const double *B,
19 const int ldb, const double beta, double *C,
23 /* Function prototypes */
24 static int mat_mult(int n)
31 A = malloc(n*n*sizeof(double));
32 B = malloc(n*n*sizeof(double));
33 C = malloc(n*n*sizeof(double));
35 start=now=gras_os_time();
37 INFO1("Matrix size: %d",n);
38 /* INFO1("Before computation: %lg", start); */
42 GRAS_BENCH_ONCE_RUN_ONCE_BEGIN();
50 cblas_dgemm(CblasRowMajor,
51 CblasNoTrans, CblasNoTrans, n, n, n,
52 1.0, A, n, B, n, 0.0, C, n);
53 GRAS_BENCH_ONCE_RUN_ONCE_END();
54 now=gras_os_time()-now;
55 /* INFO2("Iteration %d : %lg ", l, now); */
58 now=gras_os_time()-start;
59 INFO1("Duration: %lg ", now);
66 int multiplier (int argc,char *argv[])
68 gras_init(&argc, argv);