10main(
int argc,
char **argv )
23 printf(
"Test case hwinfo.c: "
24 "Check output of PAPI_get_hardware_info.\n");
27 if ( hwinfo == NULL ) {
28 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
37 test_fail( __FILE__, __LINE__,
"Vendor unknown", 0 );
40 test_fail( __FILE__, __LINE__,
"Mhz unknown", 0 );
42 if ( hwinfo->
ncpu < 1 )
43 test_fail( __FILE__, __LINE__,
"ncpu < 1", 0 );
46 test_fail( __FILE__, __LINE__,
"totalcpus < 1", 0 );
55 test_fail( __FILE__, __LINE__,
"max mh level < 0", 0 );
58 printf(
"Max level of TLB or Cache: %d\n", mh->
levels );
63 printf(
"Level %d, TLB %d: %d, %d, %d\n",
i, j, t->
type,
65 printf(
"Level %d, Cache %d: %d, %d, %d, %d, %d\n",
i, j,
c->type,
66 c->size,
c->line_size,
c->num_lines,
c->associativity );
get information about the system hardware
initialize the PAPI library.
#define PAPI_VENDOR_UNKNOWN
static double c[MATRIX_SIZE][MATRIX_SIZE]
Return codes and api definitions.
#define PAPI_MH_MAX_LEVELS
int tests_quiet(int argc, char **argv)
void validate_string(const char *name, char *s)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)
char vendor_string[PAPI_MAX_STR_LEN]
PAPI_mh_info_t mem_hierarchy
char model_string[PAPI_MAX_STR_LEN]
mh for mem hierarchy maybe?
PAPI_mh_level_t level[PAPI_MAX_MEM_HIERARCHY_LEVELS]
PAPI_mh_tlb_info_t tlb[PAPI_MH_MAX_LEVELS]
PAPI_mh_cache_info_t cache[PAPI_MH_MAX_LEVELS]