PAPI
5.7.0.0
Functions
busy_work.c File Reference
Include dependency graph for busy_work.c:
Go to the source code of this file.
Functions
double
do_cycles
(int minimum_time)
Function Documentation
◆
do_cycles()
double do_cycles
(
int
minimum_time
)
Definition at line
8
of file
busy_work.c
.
9
{
10
struct
timeval
start
, now;
11
double
x
, sum;
12
13
gettimeofday
( &
start
, NULL );
14
15
for
( ;; ) {
16
sum = 1.0;
17
for
(
x
= 1.0;
x
< 250000.0;
x
+= 1.0 ) {
18
sum +=
x
;
19
}
20
if
( sum < 0.0 ) {
21
printf(
"==>> SUM IS NEGATIVE !! <<==\n"
);
22
}
23
24
gettimeofday
( &now, NULL );
25
if
( now.tv_sec >=
start
.
tv_sec
+ minimum_time ) {
26
break
;
27
}
28
}
29
return
sum;
30
}
start
static struct timeval start
Definition:
krentel_pthreads.c:27
timeval
Definition:
papi_fwrappers_.c:1338
timeval::tv_sec
__time_t tv_sec
Definition:
papi_fwrappers_.c:1340
gettimeofday
int gettimeofday(void *ptr1, void *ptr2)
Definition:
cuda_ld_preload_example.c:76
x
int x
Definition:
fileop.c:78
Here is the call graph for this function:
src
validation_tests
busy_work.c
Generated on Wed Mar 27 2019 00:55:11 for PAPI by
1.8.15