PAPI  5.7.0.0
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 }
static double array[ARRAYSIZE]
Definition: papi_l1_dca.c:23
static long count
int i
Definition: fileop.c:140

◆ 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 }
static double array[ARRAYSIZE]
Definition: papi_l1_dca.c:23
static long count
int i
Definition: fileop.c:140

◆ 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 }
static double array[ARRAYSIZE]
Definition: papi_l1_dca.c:23
int i
Definition: fileop.c:140

◆ 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 }
static double array[ARRAYSIZE]
Definition: papi_l1_dca.c:23
int i
Definition: fileop.c:140