HEBench
|
Namespaces | |
Compiler | |
cpp | |
Classes | |
struct | _TimingReportEventC |
struct | _UnitPrefix |
struct | OverviewHeader |
struct | StatisticsResult |
struct | ReportEventTypeStats |
class | ReportStats |
class | EventType |
Extracts and maintains the timing report events of the same type. More... | |
class | TimingReportImpl |
Typedefs | |
typedef struct _TimingReportEventC | TimingReportEventC |
typedef struct _UnitPrefix | TimingPrefixedSeconds |
Functions | |
void * | allocateReport () |
void | freeReport (void *p_report) |
int32_t | setReportHeader (void *p_report, const char *new_header) |
int32_t | appendReportHeader (void *p_report, const char *new_header, int32_t new_line) |
Appends text to existing header. More... | |
int32_t | prependReportHeader (void *p_report, const char *new_header, int32_t new_line) |
Prepends text to existing header. More... | |
uint64_t | getReportHeader (void *p_report, char *header, uint64_t size) |
int32_t | setReportFooter (void *p_report, const char *new_footer) |
int32_t | appendReportFooter (void *p_report, const char *new_footer, int32_t new_line) |
Appends text to existing footer. More... | |
int32_t | prependReportFooter (void *p_report, const char *new_footer, int32_t new_line) |
Prepends text to existing footer. More... | |
uint64_t | getReportFooter (void *p_report, char *footer, uint64_t size) |
int32_t | addEventType (void *p_report, uint32_t event_type_id, const char *event_type_header) |
addEventType More... | |
int32_t | addMainEventType (void *p_report, uint32_t event_type_id, const char *event_type_header) |
Adds an event type and marks it as the main event. More... | |
int32_t | hasEventType (void *p_report, uint32_t event_type_id) |
hasEventType More... | |
uint64_t | getEventTypeHeader (void *p_report, uint32_t event_type_id, char *event_type_header, uint64_t size) |
uint64_t | getEventTypeCount (void *p_report) |
uint32_t | getEventType (void *p_report, uint64_t index) |
Retrieve an event type ID. More... | |
int32_t | getMainEventType (void *p_report, uint32_t *p_event_type_id) |
getMainEventType More... | |
int32_t | addEvent (void *p_report, const TimingReportEventC *p_event) |
addEvent More... | |
int32_t | getEvent (void *p_report, TimingReportEventC *p_event, uint64_t index) |
getEvent More... | |
uint64_t | getEventCount (void *p_report) |
uint64_t | getEventCapacity (void *p_report) |
int32_t | setEventCapacity (void *p_report, uint64_t new_capacity) |
setEventCapacity More... | |
int32_t | clearEvents (void *p_report) |
int32_t | save2CSV (void *p_report, const char *filename) |
int32_t | convert2CSV (void *p_report, char **pp_csv_content) |
convert2CSV More... | |
void | freeCSVContent (char *p_csv_content) |
Releases resources allocated by functions that generate CSV formatted reports from a timing report. More... | |
void * | loadReportFromCSV (const char *p_csv_content, char error_description[MAX_DESCRIPTION_BUFFER_SIZE]) |
void * | loadReportFromCSVFile (const char *filename, char error_description[MAX_DESCRIPTION_BUFFER_SIZE]) |
int32_t | setTimingPrefix (TimingPrefixedSeconds *p_prefix, double seconds, char prefix) |
Computes the value for the time unit based on a specified prefix. More... | |
int32_t | computeTimingPrefix (TimingPrefixedSeconds *p_prefix, double seconds) |
Retrieves the prefix for the time unit. More... | |
void | computeStats (StatisticsResult &result, const double *data, std::size_t count) |
std::string | to_string (const std::string_view &s) |
struct hebench::ReportGen::_TimingReportEventC |
Definition at line 20 of file hebench_report_types.h.
Class Members | ||
---|---|---|
double | cpu_time_end | |
double | cpu_time_start | |
char | description[MAX_TIME_REPORT_EVENT_DESCRIPTION_SIZE] |
Description attached to this event. Set to empty string if no description. |
uint32_t | event_type_id |
ID specifying the event type. During summary report, events with the same ID will be grouped together for statistical computations. Users must make sure that related events are tagged with the correct ID. |
uint64_t | input_sample_count | |
int64_t | time_interval_ratio_den |
Scale of time interval used for this event.
|
int64_t | time_interval_ratio_num |
Scale of time interval used for this event. Timing values in this instance are given in this scale. This represents the ratio of this scale with respect to double wall_time_start Definition: hebench_report_types.h:31 int64_t time_interval_ratio_num Scale of time interval used for this event. Definition: hebench_report_types.h:45 double wall_time_end Definition: hebench_report_types.h:32 int64_t time_interval_ratio_den Scale of time interval used for this event. Definition: hebench_report_types.h:50 Similarly for CPU time. |
double | wall_time_end | |
double | wall_time_start |
struct hebench::ReportGen::_UnitPrefix |
Definition at line 60 of file hebench_report_types.h.
Class Members | ||
---|---|---|
char | prefix[MAX_DESCRIPTION_BUFFER_SIZE] |
Full name for the prefix (or empty string if no prefix). milli, micro, nano |
char | symbol[MAX_SYMBOL_BUFFER_SIZE] |
Symbol for the prefix. m for milli, u micro, n for nano |
int64_t | time_interval_ratio_den |
Denominator of timing scale ratio with respect to a unit. Numerator is always 1. |
double | value | Value in the specified unit. |
struct hebench::ReportGen::StatisticsResult |
Definition at line 22 of file hebench_report_stats.h.
struct hebench::ReportGen::ReportEventTypeStats |
Definition at line 41 of file hebench_report_stats.h.
typedef struct _UnitPrefix hebench::ReportGen::TimingPrefixedSeconds |
Definition at line 1 of file hebench_report_types.h.
typedef struct _TimingReportEventC hebench::ReportGen::TimingReportEventC |
Definition at line 1 of file hebench_report_types.h.
int32_t hebench::ReportGen::addEvent | ( | void * | p_report, |
const TimingReportEventC * | p_event | ||
) |
addEvent
p_report | |
p_event |
true
on success. Definition at line 366 of file hebench_report.cpp.
int32_t hebench::ReportGen::addEventType | ( | void * | p_report, |
uint32_t | event_type_id, | ||
const char * | event_type_header | ||
) |
addEventType
p_report | |
event_type_id | |
event_type_header |
true
on success.event type: groups a collection of events under the same type.
Definition at line 221 of file hebench_report.cpp.
int32_t hebench::ReportGen::addMainEventType | ( | void * | p_report, |
uint32_t | event_type_id, | ||
const char * | event_type_header | ||
) |
Adds an event type and marks it as the main event.
p_report | |
event_type_id | |
event_type_header |
true
on success.The main event is the event on which the summary will focus.
Definition at line 242 of file hebench_report.cpp.
void * hebench::ReportGen::allocateReport | ( | ) |
Definition at line 23 of file hebench_report.cpp.
int32_t hebench::ReportGen::appendReportFooter | ( | void * | p_report, |
const char * | new_footer, | ||
int32_t | new_line | ||
) |
Appends text to existing footer.
p_report | |
new_footer | |
new_line | If true a new line will be added after current footer before appending new_footer . |
true
on success Definition at line 160 of file hebench_report.cpp.
int32_t hebench::ReportGen::appendReportHeader | ( | void * | p_report, |
const char * | new_header, | ||
int32_t | new_line | ||
) |
Appends text to existing header.
p_report | |
new_header | |
new_line | If true a new line will be added after current header before appending new_header . |
true
on success Definition at line 78 of file hebench_report.cpp.
int32_t hebench::ReportGen::clearEvents | ( | void * | p_report | ) |
Definition at line 471 of file hebench_report.cpp.
void hebench::ReportGen::computeStats | ( | StatisticsResult & | result, |
const double * | data, | ||
std::size_t | count | ||
) |
Definition at line 20 of file hebench_report_stats.cpp.
int32_t hebench::ReportGen::computeTimingPrefix | ( | TimingPrefixedSeconds * | p_prefix, |
double | seconds | ||
) |
Retrieves the prefix for the time unit.
[out] | p_prefix | Structure where to store the result. |
[in] | seconds | Time in seconds for which to compute prefix. |
Given a timing in seconds, this function will compute the metric prefix. The time used are: greater than 1: seconds between 1 and 0.001: milliseconds between 0.001 and 0.000001: microseconds between 0.000001 and 0.000000001: nanoseconds
Definition at line 640 of file hebench_report.cpp.
int32_t hebench::ReportGen::convert2CSV | ( | void * | p_report, |
char ** | pp_csv_content | ||
) |
convert2CSV
p_report | ||
[out] | pp_csv_content | Deallocate using freeCSVContent() |
true
on success. Definition at line 518 of file hebench_report.cpp.
void hebench::ReportGen::freeCSVContent | ( | char * | p_csv_content | ) |
Releases resources allocated by functions that generate CSV formatted reports from a timing report.
[in] | p_csv_content | Pointer to the string buffer allocated by functions that generate CSV reports. |
Use this function to free resources allocated by convert2CSV()
, generateSummaryCSV()
, and similar functions.
Definition at line 553 of file hebench_report.cpp.
void hebench::ReportGen::freeReport | ( | void * | p_report | ) |
Definition at line 43 of file hebench_report.cpp.
int32_t hebench::ReportGen::getEvent | ( | void * | p_report, |
TimingReportEventC * | p_event, | ||
uint64_t | index | ||
) |
getEvent
p_report | |
p_event | |
index |
true
on success. Definition at line 391 of file hebench_report.cpp.
uint64_t hebench::ReportGen::getEventCapacity | ( | void * | p_report | ) |
Definition at line 431 of file hebench_report.cpp.
uint64_t hebench::ReportGen::getEventCount | ( | void * | p_report | ) |
Definition at line 412 of file hebench_report.cpp.
uint32_t hebench::ReportGen::getEventType | ( | void * | p_report, |
uint64_t | index | ||
) |
Retrieve an event type ID.
p_report | ||
[in] | index | Index of the event type to retrieve. Must be less than getEventTypeCount() . |
Definition at line 324 of file hebench_report.cpp.
uint64_t hebench::ReportGen::getEventTypeCount | ( | void * | p_report | ) |
Definition at line 305 of file hebench_report.cpp.
uint64_t hebench::ReportGen::getEventTypeHeader | ( | void * | p_report, |
uint32_t | event_type_id, | ||
char * | event_type_header, | ||
uint64_t | size | ||
) |
Definition at line 282 of file hebench_report.cpp.
int32_t hebench::ReportGen::getMainEventType | ( | void * | p_report, |
uint32_t * | p_event_type_id | ||
) |
getMainEventType
p_report | |
p_event_type_id |
true
if report has main event type and it was successfully retrieved into p_event_type_id
. false
on error or otherwise. Definition at line 343 of file hebench_report.cpp.
uint64_t hebench::ReportGen::getReportFooter | ( | void * | p_report, |
char * | footer, | ||
uint64_t | size | ||
) |
Definition at line 202 of file hebench_report.cpp.
uint64_t hebench::ReportGen::getReportHeader | ( | void * | p_report, |
char * | header, | ||
uint64_t | size | ||
) |
Definition at line 120 of file hebench_report.cpp.
int32_t hebench::ReportGen::hasEventType | ( | void * | p_report, |
uint32_t | event_type_id | ||
) |
hasEventType
p_report | |
event_type_id |
Definition at line 263 of file hebench_report.cpp.
void * hebench::ReportGen::loadReportFromCSV | ( | const char * | p_csv_content, |
char | error_description[MAX_DESCRIPTION_BUFFER_SIZE] | ||
) |
Definition at line 559 of file hebench_report.cpp.
void * hebench::ReportGen::loadReportFromCSVFile | ( | const char * | filename, |
char | error_description[MAX_DESCRIPTION_BUFFER_SIZE] | ||
) |
Definition at line 587 of file hebench_report.cpp.
int32_t hebench::ReportGen::prependReportFooter | ( | void * | p_report, |
const char * | new_footer, | ||
int32_t | new_line | ||
) |
Prepends text to existing footer.
p_report | |
new_footer | |
new_line | If true, new_footer , followed by a new line, will be prepended to the current footer. Otherwise, the current footer will follow new_footer immediately without a new line. |
true
on success Definition at line 181 of file hebench_report.cpp.
int32_t hebench::ReportGen::prependReportHeader | ( | void * | p_report, |
const char * | new_header, | ||
int32_t | new_line | ||
) |
Prepends text to existing header.
p_report | |
new_header | |
new_line | If true, new_header , followed by a new line, will be prepended to the current header. Otherwise, the current header will follow new_header immediately without a new line. |
true
on success Definition at line 99 of file hebench_report.cpp.
int32_t hebench::ReportGen::save2CSV | ( | void * | p_report, |
const char * | filename | ||
) |
Definition at line 492 of file hebench_report.cpp.
int32_t hebench::ReportGen::setEventCapacity | ( | void * | p_report, |
uint64_t | new_capacity | ||
) |
setEventCapacity
p_report | |
new_capacity |
true
on success. Definition at line 450 of file hebench_report.cpp.
int32_t hebench::ReportGen::setReportFooter | ( | void * | p_report, |
const char * | new_footer | ||
) |
Definition at line 139 of file hebench_report.cpp.
int32_t hebench::ReportGen::setReportHeader | ( | void * | p_report, |
const char * | new_header | ||
) |
Definition at line 57 of file hebench_report.cpp.
int32_t hebench::ReportGen::setTimingPrefix | ( | TimingPrefixedSeconds * | p_prefix, |
double | seconds, | ||
char | prefix | ||
) |
Computes the value for the time unit based on a specified prefix.
[out] | p_prefix | Structure where to store the result. |
[in] | seconds | Time in seconds for which to compute prefix. |
[in] | prefix | Timing prefix specification. See details. |
Given a timing in seconds and the metric prefix, this function will compute the corresponding value.
Values for prefix
are:
0: behaves as computeTimingPrefix() ‘'s’: result is in seconds.
'm': result is in milliseconds.
'u': result is in microseconds.
'n'`: result is in nanoseconds.
Any other value makes the function return a failure.
For example, if seconds
is 0.05
and prefix
is m
, then, the result is:
Definition at line 622 of file hebench_report.cpp.
std::string hebench::ReportGen::to_string | ( | const std::string_view & | s | ) |
Definition at line 18 of file hebench_report_impl.cpp.