PLASMA  2.4.5
PLASMA - Parallel Linear Algebra for Scalable Multi-core Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
coreblas_macros.h
Go to the documentation of this file.
1 
14 #ifndef _COREBLAS_EZTRACE_H_
15 #define _COREBLAS_EZTRACE_H_
16 
17 /* #define VERBOSE 1 */
18 #ifdef VERBOSE
19 #define FUNCTION_NAME fprintf(stderr, "Calling [%s]\n", __FUNCTION__)
20 #else
21 #define FUNCTION_NAME
22 #endif
23 
24 /*
25  * Macro for coreblas functions which returns void.
26  * It generates an event with the BLAS/LAPACK name
27  * when it starts and a STOP event when it's finished.
28  */
29 #define FUNCTION_VOID(name, shname, rettype, args, params) \
30  rettype P##name args ; \
31  rettype name args { \
32  FUNCTION_NAME; \
33  EZTRACE_EVENT0(FUT_COREBLAS_##shname); \
34  P##name params; \
35  EZTRACE_EVENT0(FUT_COREBLAS_STOP); \
36  }
37 
38 /*
39  * Macro for coreblas functions which returns something
40  * different from void.
41  * It generates an event with the BLAS/LAPACK name
42  * when it starts and a STOP event when it's finished.
43  */
44 #define FUNCTION_TYPE(name, shname, rettype, args, params) \
45  rettype P##name args ; \
46  rettype name args { \
47  rettype ret; \
48  FUNCTION_NAME; \
49  EZTRACE_EVENT0(FUT_COREBLAS_##shname); \
50  ret = P##name params; \
51  EZTRACE_EVENT0(FUT_COREBLAS_STOP); \
52  return ret; \
53  }
54 
55 /*
56  * Macro for quark wrapper used in coreblas library.
57  * It generates an event with the BLAS/LAPACK name
58  * of the function called, and an event to decrease
59  * the number of tasks available.
60  * At the end, the STOP event is generated.
61  */
62 #define FUNCTION_QUARK(name, shname) \
63  void P##name (Quark *quark); \
64  void name(Quark *quark) { \
65  FUNCTION_NAME; \
66  EZTRACE_EVENT2(FUT_COREBLAS_##shname, \
67  QUARK_Get_Priority(quark), \
68  QUARK_Get_Sequence(quark)); \
69  P##name(quark); \
70  EZTRACE_EVENT0(FUT_COREBLAS_STOP); \
71  }
72 
73 #endif /* _COREBLAS_EZTRACE_H_ */