MAGMA  2.3.0
Matrix Algebra for GPU and Multicore Architectures
 All Classes Files Functions Friends Groups Pages
Timer utilities

Functions

static void timer_start (magma_timer_t &t)
 
static void timer_sync_start (magma_timer_t &t, magma_queue_t queue)
 
static magma_timer_t timer_stop (magma_timer_t &t)
 
static magma_timer_t timer_sync_stop (magma_timer_t &t, magma_queue_t queue)
 
static void flops_start (magma_flops_t &flops)
 
static magma_flops_t flops_stop (magma_flops_t &flops)
 
static int timer_printf (const char *format,...) __attribute__((format(printf
 If ENABLE_TIMER is defined, same as printf; else does nothing (returns 0).
 
static int timer_fprintf (FILE *stream, const char *format,...) __attribute__((format(printf
 If ENABLE_TIMER is defined, same as fprintf; else does nothing (returns 0).
 
static int timer_snprintf (char *str, size_t size, const char *format,...) __attribute__((format(printf
 If ENABLE_TIMER is defined, same as snprintf; else does nothing (returns 0).
 

Detailed Description

Function Documentation

static void timer_start ( magma_timer_t &  t)
inlinestatic
Parameters
[out]tOn output, set to current time.

If ENABLE_TIMER is not defined, does nothing.

static void timer_sync_start ( magma_timer_t &  t,
magma_queue_t  queue 
)
inlinestatic
Parameters
[out]tOn output, set to current time.
[in]queueQueue to sync with, before getting time.

If ENABLE_TIMER is not defined, does nothing.

static magma_timer_t timer_stop ( magma_timer_t &  t)
inlinestatic
Parameters
[in,out]tOn input, time when timer_start() was called. On output, set to (current time - start time).
Returns
t, to sum up times:
magma_timer_t time, time_sum=0;
for( ... ) {
    timer_start( time );
    ...do timed operations...
    time_sum += timer_stop( time );

    ...do other operations...
}

If ENABLE_TIMER is not defined, returns 0.

static magma_timer_t timer_sync_stop ( magma_timer_t &  t,
magma_queue_t  queue 
)
inlinestatic
Parameters
[in,out]tOn input, time when timer_start() was called. On output, set to (current time - start time).
[in]queueQueue to sync with, before getting time.
Returns
t, to sum up times:
magma_timer_t time, time_sum=0;
for( ... ) {
    timer_start( time );
    ...do timed operations...
    time_sum += timer_stop( time );

    ...do other operations...
}

If ENABLE_TIMER is not defined, returns 0.

static void flops_start ( magma_flops_t &  flops)
inlinestatic
Parameters
[out]flopsOn output, set to current flop counter.

Requires global gPAPI_flops_set to be setup by testing/magma_util.cpp Note that newer CPUs may not support flop counts; see https://icl.cs.utk.edu/projects/papi/wiki/PAPITopics:SandyFlops

If ENABLE_TIMER and HAVE_PAPI are not both defined, does nothing.

static magma_flops_t flops_stop ( magma_flops_t &  flops)
inlinestatic
Parameters
[out]flopsOn input, flop counter when flops_start() was called. On output, set to (current flop counter - start flop counter).
Returns
flops, so you can sum up; see timer_stop().

If ENABLE_TIMER and HAVE_PAPI are not both defined, returns 0.