3 /* chrono - demo of GRAS benchmarking features */
5 /* Copyright (c) 2005 Martin Quinson, Arnaud Legrand. All rights reserved. */
7 /* This program is free software; you can redistribute it and/or modify it
8 * under the terms of the license (GNU LGPL) which comes with this package. */
13 XBT_LOG_NEW_DEFAULT_CATEGORY(Chrono,"Messages specific to this example");
16 void cblas_dgemm(const enum CBLAS_ORDER Order,
17 const enum CBLAS_TRANSPOSE TransA,
18 const enum CBLAS_TRANSPOSE TransB, const int M,
19 const int N, const int K, const double alpha,
20 const double *A, const int lda, const double *B,
21 const int ldb, const double beta, double *C,
25 /* Function prototypes */
26 static int mat_mult(int n)
33 A = malloc(n*n*sizeof(double));
34 B = malloc(n*n*sizeof(double));
35 C = malloc(n*n*sizeof(double));
37 start=now=gras_os_time();
39 INFO1("Matrix size: %d",n);
40 /* INFO1("Before computation: %lg", start); */
44 GRAS_BENCH_ONCE_RUN_ONCE_BEGIN();
52 cblas_dgemm(CblasRowMajor,
53 CblasNoTrans, CblasNoTrans, n, n, n,
54 1.0, A, n, B, n, 0.0, C, n);
55 GRAS_BENCH_ONCE_RUN_ONCE_END();
56 now=gras_os_time()-now;
57 /* INFO2("Iteration %d : %lg ", l, now); */
60 now=gras_os_time()-start;
61 INFO1("Duration: %lg ", now);
68 int multiplier (int argc,char *argv[])
70 gras_init(&argc, argv);