S3FC project page S3FC home page

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

s3_timer.h File Reference

#include <iomanip>

Include dependency graph for s3_timer.h:

Include dependency graph

Go to the source code of this file.

Defines

#define CYCLE_SPEED   450e6
#define s3_timer_init(proc)
#define s3_timer_extern(proc)
#define s3_timer_reset(proc)   s3timer_total_##proc = 0
#define s3_timer_start(proc)   asm volatile("rdtsc" : "=A"(*( &s3timer_start_##proc)))
#define s3_timer_stop_add(proc)
#define s3_timer_get_seconds(proc)   ( (float)s3timer_total_##proc / (float)CYCLE_SPEED )
#define WIDTH_NAME   15
#define WIDTH_TOTAL_SECS   23
#define WIDTH_PER_SECS   23
#define WIDTH_PERCENT   15
#define s3_timer_header(total_time, number_trials)
#define s3_timer_report_init
#define s3_timer_line(proc, str_name)
#define s3_timer_footer


Define Documentation

#define CYCLE_SPEED   450e6
 

Definition at line 85 of file s3_timer.h.

#define s3_timer_extern proc   
 

Value:

extern long long s3timer_start_##proc;     \
extern long long s3timer_stop_##proc;      \
extern long long s3timer_total_##proc

Definition at line 93 of file s3_timer.h.

#define s3_timer_footer
 

Value:

for (int j=0; j<WIDTH_NAME+WIDTH_TOTAL_SECS+WIDTH_PER_SECS+WIDTH_PERCENT; j++)\
    std::cout << "-"; std::cout.setf(std::ios::fixed); std::cout << std::endl                          \
    << std::setw(WIDTH_NAME) << "Total:" <<                                        \
    std::setw(WIDTH_TOTAL_SECS-2) << std::setfill(' ') << std::setprecision(4) <<            \
    s3timer_time_accum                                                        \
    << std::setw(WIDTH_PER_SECS+WIDTH_PERCENT-0) <<                                \
    s3timer_precentage_accum*100 << " %" << std::endl

Definition at line 154 of file s3_timer.h.

#define s3_timer_get_seconds proc       ( (float)s3timer_total_##proc / (float)CYCLE_SPEED )
 

Definition at line 108 of file s3_timer.h.

#define s3_timer_header total_time,
number_trials   
 

Value:

std::cout << std::setw(WIDTH_NAME)      << "Name"                                       \
    << std::setw(WIDTH_TOTAL_SECS) << "Total time [secs]"                          \
    << std::setw(WIDTH_PER_SECS)   << "Time per trial [ms]"                        \
    << std::setw(WIDTH_PERCENT)    << "Percentage "                                \
    << std::endl;                                                                  \
for (int i=0; i<WIDTH_NAME+WIDTH_TOTAL_SECS+WIDTH_PER_SECS+WIDTH_PERCENT; i++)\
    std::cout << "-"; std::cout << std::endl;                                                \
s3timer_precentage_accum = 0;                                                 \
s3timer_time_accum = 0;                                                       \
s3timer_number_trials = number_trials;                                        \
s3timer_total_time = total_time

Definition at line 117 of file s3_timer.h.

#define s3_timer_init proc   
 

Value:

long long s3timer_start_##proc = 0;            \
long long s3timer_stop_##proc = 0;             \
long long s3timer_total_##proc = 0

Definition at line 88 of file s3_timer.h.

#define s3_timer_line proc,
str_name   
 

Value:

std::cout << std::setw(WIDTH_NAME) << str_name                                          \
    << std::setw(WIDTH_TOTAL_SECS-2) << std::setfill(' ') << std::setprecision(4) <<         \
        (float)s3timer_total_##proc / (float)CYCLE_SPEED                      \
    << std::setw(WIDTH_PER_SECS) << std::setfill(' ') << std::setprecision(4) <<             \
        (float)s3timer_total_##proc / (float)CYCLE_SPEED /                    \
   s3timer_number_trials * 1000                                          \
    << std::setw(WIDTH_PERCENT) << std::setfill(' ') << std::setprecision(4) <<              \
        (float)s3timer_total_##proc / (float)CYCLE_SPEED /                    \
        s3timer_total_time*100                                                \
    << std::endl;                                                                  \
s3timer_time_accum +=                                                         \
            (float)s3timer_total_##proc / (float)CYCLE_SPEED;                 \
s3timer_precentage_accum +=                                                   \
            (float)s3timer_total_##proc / (float)CYCLE_SPEED /                \
      s3timer_total_time

Definition at line 137 of file s3_timer.h.

#define s3_timer_report_init
 

Value:

float s3timer_precentage_accum = 0;                                           \
float s3timer_time_accum = 0;                                                 \
float s3timer_number_trials = 0;                                              \
float s3timer_total_time = 04

Definition at line 130 of file s3_timer.h.

#define s3_timer_reset proc       s3timer_total_##proc = 0
 

Definition at line 98 of file s3_timer.h.

#define s3_timer_start proc       asm volatile("rdtsc" : "=A"(*( &s3timer_start_##proc)))
 

Definition at line 101 of file s3_timer.h.

#define s3_timer_stop_add proc   
 

Value:

asm volatile("rdtsc" : "=A"(*(&s3timer_stop_##proc)));                       \
s3timer_total_##proc += (s3timer_stop_##proc - s3timer_start_##proc )

Definition at line 104 of file s3_timer.h.

#define WIDTH_NAME   15
 

Definition at line 111 of file s3_timer.h.

#define WIDTH_PER_SECS   23
 

Definition at line 113 of file s3_timer.h.

#define WIDTH_PERCENT   15
 

Definition at line 114 of file s3_timer.h.

#define WIDTH_TOTAL_SECS   23
 

Definition at line 112 of file s3_timer.h.


Send comments to: s3fc@stonethree.com SourceForge Logo