ppw_papi.h
Go to the documentation of this file.00001
00008 #include <papi.h>
00009
00011 struct ppw_papi_handle {
00012 int papi_eventset;
00013 int papi_numcounters;
00014 long_long papi_values[PPW_MAX_COUNTERS];
00015 ppw_profile profh;
00016 };
00017 typedef struct ppw_papi_handle *ppw_papi;
00018
00020 extern ppw_papi ppw_papi_init(const char *opt_papimetrics, ppw_profile profh,
00021 char using_pthreads);
00022
00024 #define PPW_PAPI_NUMCOUNTERS(papih) (papih->papi_numcounters)
00025
00027 #define PPW_PAPI_COUNTERVAL(papih, i) (papih->papi_values[i])
00028
00040 #define PPW_PAPI_UPDATECOUNTERS(papih) { \
00041 if (papih->papi_numcounters > 0) { \
00042 PAPI_read(papih->papi_eventset, papih->papi_values); \
00043 } \
00044 }
00045
00047 extern void ppw_papi_cleanup(ppw_papi h);
00048