PAPI 7.1.0.0
Loading...
Searching...
No Matches
cache_testcode.c File Reference
Include dependency graph for cache_testcode.c:

Go to the source code of this file.

Functions

int cache_write_test (double *array, int size)
 
double cache_read_test (double *array, int size)
 
int cache_random_write_test (double *array, int size, int count)
 
double cache_random_read_test (double *array, int size, int count)
 

Function Documentation

◆ cache_random_read_test()

double cache_random_read_test ( double *  array,
int  size,
int  count 
)

Definition at line 38 of file cache_testcode.c.

38 {
39
40 int i;
41 double sum=0;
42
43 for(i=0; i<count; i++) {
44 sum+= array[random()%size];
45 }
46
47 return sum;
48}
int i
static long count
static double array[ARRAYSIZE]
Definition: papi_l1_dca.c:23
Here is the caller graph for this function:

◆ cache_random_write_test()

int cache_random_write_test ( double *  array,
int  size,
int  count 
)

Definition at line 28 of file cache_testcode.c.

28 {
29 int i;
30
31 for(i=0; i<count; i++) {
32 array[random()%size]=(double)i;
33 }
34
35 return 0;
36}
Here is the caller graph for this function:

◆ cache_read_test()

double cache_read_test ( double *  array,
int  size 
)

Definition at line 16 of file cache_testcode.c.

16 {
17
18 int i;
19 double sum=0;
20
21 for(i=0; i<size; i++) {
22 sum+= array[i];
23 }
24
25 return sum;
26}
Here is the caller graph for this function:

◆ cache_write_test()

int cache_write_test ( double *  array,
int  size 
)

Definition at line 6 of file cache_testcode.c.

6 {
7 int i;
8
9 for(i=0; i<size; i++) {
10 array[i]=(double)i;
11 }
12
13 return 0;
14}
Here is the caller graph for this function: