|
PAPI
5.0.1.0
|

Go to the source code of this file.
Functions | |
| main () | |
| int | your_slow_code () |
| main | ( | ) |
Definition at line 23 of file PAPI_flops.c.
{
float real_time, proc_time,mflops;
long long flpops;
float ireal_time, iproc_time, imflops;
long long iflpops;
int retval;
/***********************************************************************
* if PAPI_FP_OPS is a derived event in your platform, then your *
* platform must have at least three counters to support PAPI_flops, *
* because PAPI needs one counter to cycles. So in UltraSparcIII, even *
* the platform supports PAPI_FP_OPS, but UltraSparcIII only has two *
* available hardware counters and PAPI_FP_OPS is a derived event in *
* this platform, so PAPI_flops returns an error. *
***********************************************************************/
if((retval=PAPI_flops(&ireal_time,&iproc_time,&iflpops,&imflops)) < PAPI_OK)
{
printf("Could not initialise PAPI_flops \n");
printf("Your platform may not support floating point operation event.\n");
printf("retval: %d\n", retval);
exit(1);
}
your_slow_code();
if((retval=PAPI_flops( &real_time, &proc_time, &flpops, &mflops))<PAPI_OK)
{
printf("retval: %d\n", retval);
exit(1);
}
printf("Real_time: %f Proc_time: %f Total flpops: %lld MFLOPS: %f\n",
real_time, proc_time,flpops,mflops);
exit(0);
}

| int your_slow_code | ( | ) |
Definition at line 63 of file PAPI_flops.c.