MAGMA  1.2.0
MatrixAlgebraonGPUandMulticoreArchitectures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
timer.cpp File Reference
#include "common_magma.h"
#include <sys/time.h>
Include dependency graph for timer.cpp:

Go to the source code of this file.

Functions

magma_timestr_t get_current_time (void)
double GetTimerValue (magma_timestr_t start, magma_timestr_t end)
double magma_wtime (void)
void magma_wtime_f (double *time)

Function Documentation

magma_timestr_t get_current_time ( void  )

Definition at line 76 of file timer.cpp.

{
struct timeval time_val;
cudaDeviceSynchronize();
gettimeofday(&time_val, NULL);
time.sec = time_val.tv_sec;
time.usec = time_val.tv_usec;
return (time);
}

Here is the caller graph for this function:

double GetTimerValue ( magma_timestr_t  start,
magma_timestr_t  end 
)

Definition at line 94 of file timer.cpp.

{
int sec, usec;
sec = end.sec - start.sec;
usec = end.usec - start.usec;
return (1000.*(double)(sec) + (double)(usec) * 0.001);
}

Here is the caller graph for this function:

double magma_wtime ( void  )

Definition at line 110 of file timer.cpp.

{
struct timeval t;
gettimeofday( &t, NULL );
return t.tv_sec + t.tv_usec*1e-6;
}

Here is the caller graph for this function:

void magma_wtime_f ( double *  time)

Definition at line 119 of file timer.cpp.

References magma_wtime().

{
*time = magma_wtime();
}

Here is the call graph for this function:

Here is the caller graph for this function: