MAGMA  magma-1.4.0
Matrix Algebra on GPU and Multicore Architectures
 All Data Structures 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)
 
double magma_sync_wtime (magma_queue_t queue)
 
void magma_wtime_f (double *time)
 

Function Documentation

magma_timestr_t get_current_time ( void  )

Definition at line 76 of file timer.cpp.

77 {
78  struct timeval time_val;
79  magma_timestr_t time;
80 
81  cudaDeviceSynchronize();
82  gettimeofday(&time_val, NULL);
83 
84  time.sec = time_val.tv_sec;
85  time.usec = time_val.tv_usec;
86  return (time);
87 }
double GetTimerValue ( magma_timestr_t  start,
magma_timestr_t  end 
)

Definition at line 94 of file timer.cpp.

95 {
96  int sec, usec;
97 
98  sec = end.sec - start.sec;
99  usec = end.usec - start.usec;
100 
101  return (1000.*(double)(sec) + (double)(usec) * 0.001);
102 }
unsigned int usec
Definition: auxiliary.h:15
unsigned int sec
Definition: auxiliary.h:14
double magma_sync_wtime ( magma_queue_t  queue)

Definition at line 119 of file timer.cpp.

References magma_queue_sync, and magma_wtime().

120 {
121  magma_queue_sync( queue );
122  return magma_wtime();
123 }
double magma_wtime(void)
Definition: timer.cpp:110
#define magma_queue_sync(queue)
Definition: magma.h:119

Here is the call graph for this function:

Here is the caller graph for this function:

double magma_wtime ( void  )

Definition at line 110 of file timer.cpp.

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

Here is the caller graph for this function:

void magma_wtime_f ( double *  time)

Definition at line 127 of file timer.cpp.

References magma_wtime().

128 {
129  *time = magma_wtime();
130 }
double magma_wtime(void)
Definition: timer.cpp:110

Here is the call graph for this function:

Here is the caller graph for this function: