11{
15
17
21
23 printf( "Test case hwinfo.c: "
24 "Check output of PAPI_get_hardware_info.\n");
25 }
27 if ( hwinfo == NULL ) {
28 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
29 }
30
32
35
37 test_fail( __FILE__, __LINE__,
"Vendor unknown", 0 );
38
40 test_fail( __FILE__, __LINE__,
"Mhz unknown", 0 );
41
42 if ( hwinfo->
ncpu < 1 )
43 test_fail( __FILE__, __LINE__,
"ncpu < 1", 0 );
44
46 test_fail( __FILE__, __LINE__,
"totalcpus < 1", 0 );
47
48
49
50
51
52
53
55 test_fail( __FILE__, __LINE__,
"max mh level < 0", 0 );
56
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 );
67 }
68 }
69 }
70
72
73 return 0;
74}
get information about the system hardware
initialize the PAPI library.
#define PAPI_VENDOR_UNKNOWN
static double c[MATRIX_SIZE][MATRIX_SIZE]
#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]