21 printf(
"Sleeping 1 second...\n" );
28#define MATRIX_SIZE 1024
43 a[
i][j]=( double )
i*(
double )j;
44 b[
i][j]=( double )
i/(
double )( j+5 );
65 if ( !
quiet ) printf(
"Matrix multiply sum: s=%lf\n",
s );
70int main (
int argc,
char **argv )
74 int retval,cid,powercap_cid=-1,numcmp;
94 if ( !
TESTS_QUIET ) printf(
"Trying all powercap events\n" );
98 for( cid=0; cid<numcmp; cid++ ) {
101 test_fail( __FILE__, __LINE__,
"PAPI_get_component_info failed\n", 0 );
103 if ( strstr( cmpinfo->
name,
"powercap" ) ) {
105 if ( !
TESTS_QUIET ) printf(
"Found powercap component at cid %d\n",powercap_cid );
108 printf(
"powercap component disabled: %s\n",
111 test_skip( __FILE__,__LINE__,
"powercap component disabled",0 );
119 test_skip( __FILE__,__LINE__,
"No powercap component found\n",0 );
123 test_skip( __FILE__,__LINE__,
"No counters in the powercap component\n",0 );
131 printf(
"\nThis test may take a few minutes to complete.\n\n" );
137 test_fail( __FILE__, __LINE__,
"Error from PAPI_event_code_to_name",
retval );
166 printf(
"%-50s%4.6f %s\n",
static const char * event_names[2]
add PAPI preset or native hardware event to an event set
Empty and destroy an EventSet.
Create a new empty PAPI EventSet.
Empty and destroy an EventSet.
Enumerate PAPI preset or native events for a given component.
Convert a numeric hardware event code to a name.
get information about a specific software component
Get the event's name and description info.
initialize the PAPI library.
Get the number of components available on the system.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
#define PAPI_HUGE_STR_LEN
static long long values[NUM_EVENTS]
Return codes and api definitions.
int tests_quiet(int argc, char **argv)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)
static double a[MATRIX_SIZE][MATRIX_SIZE]
static double b[MATRIX_SIZE][MATRIX_SIZE]
#define MATRIX_SIZE
Tests basic reading functionality of powercap component.
static double c[MATRIX_SIZE][MATRIX_SIZE]
char units[MAX_EVENTS][BUFSIZ]
char name[PAPI_MAX_STR_LEN]
char disabled_reason[PAPI_HUGE_STR_LEN]
char units[PAPI_MIN_STR_LEN]
char long_descr[PAPI_HUGE_STR_LEN]