![]() |
GHOST
1.1.2
General, Hybrid, and Optimized Sparse Toolkit
|
#include "ghost/timing.h"#include "ghost/util.h"#include <map>#include <vector>#include <sstream>#include <iostream>#include <iomanip>#include <numeric>#include <algorithm>
Classes | |
| struct | ghost_timing_perfFunc |
| struct | ghost_timing_region_accu |
| Region timing accumulator. More... | |
Functions | |
| void | ghost_timing_tick (const char *tag) |
| Save the start time for a region. More... | |
| void | ghost_timing_tock (const char *tag) |
| Save the runtime for a region using the start time from ghost_timing_tick(). More... | |
| void | ghost_timing_set_perfFunc (const char *prefix, const char *tag, ghost_compute_performance_func func, void *arg, size_t sizeofarg, const char *unit) |
| Set a performance computation function to a given tag. More... | |
| ghost_error | ghost_timing_region_create (ghost_timing_region **ri, const char *tag) |
| Obtain timing info about a specific region. More... | |
| void | ghost_timing_region_destroy (ghost_timing_region *ri) |
| Destroy a timing region. More... | |
| void | ghost_timing_destroy () |
| Free timing data structures. More... | |
| ghost_error | ghost_timing_summarystring (char **str) |
| Summarize all timed regions into a string. More... | |
Variables | |
| static map< string, ghost_timing_region_accu > | timings |
| static pthread_mutex_t | timingsMutex = PTHREAD_MUTEX_INITIALIZER |
| void ghost_timing_destroy | ( | ) |
Free timing data structures.
| ghost_error ghost_timing_region_create | ( | ghost_timing_region ** | region, |
| const char * | tag | ||
| ) |
Obtain timing info about a specific region.
| region | Where to store the information. |
| tag | The region tag. |

| void ghost_timing_region_destroy | ( | ghost_timing_region * | region | ) |
Destroy a timing region.
| region | The region. |
| void ghost_timing_set_perfFunc | ( | const char * | prefix, |
| const char * | tag, | ||
| ghost_compute_performance_func | func, | ||
| void * | arg, | ||
| size_t | sizeofarg, | ||
| const char * | unit | ||
| ) |
Set a performance computation function to a given tag.
| [in] | prefix | The prefix of the region tag. Usually the variable __ghost_functag can be used here. |
| [in] | tag | The region tag. |
| [in] | func | The performance callback function. |
| [in] | arg | Argument to the function. |
| [in] | sizeofarg | Size of the arg struct. |
| [in] | unit | The unit of performance. |

| ghost_error ghost_timing_summarystring | ( | char ** | str | ) |
Summarize all timed regions into a string.
| str | Where to store the string. |

| void ghost_timing_tick | ( | const char * | tag | ) |
Save the start time for a region.
| tag | The region tag. |

| void ghost_timing_tock | ( | const char * | tag | ) |
Save the runtime for a region using the start time from ghost_timing_tick().
| tag | The region tag. |

|
static |
|
static |
1.8.6