5 #ifndef _HEBench_Harness_Utilities_SRC_0596d40a3cce4b108a81595c50eb286d
6 #define _HEBench_Harness_Utilities_SRC_0596d40a3cce4b108a81595c50eb286d
10 #include "../hebench_utilities_harness.h"
11 #include "hebench/modules/general/include/hebench_utilities.h"
19 bool output_row_index,
22 std::uint64_t max_rows = 0;
23 if (p_buffers && count > 0)
25 auto it = std::max_element(p_buffers, p_buffers + count,
29 max_rows = (*it)->size /
sizeof(T);
32 for (std::uint64_t row_i = 0; row_i < max_rows; ++row_i)
37 for (std::size_t buffer_i = 0; buffer_i < count; ++buffer_i)
41 if (p_buffers[buffer_i]->p && row_i < p_buffers[buffer_i]->size /
sizeof(T))
42 os <<
reinterpret_cast<T *
>(p_buffers[buffer_i]->p)[row_i];
48 template <
class TimeInterval>
51 this->addEvent<TimeInterval>(p_event,
nullptr);
54 template <
class TimeInterval>
56 const std::string &event_type_name)
58 this->addEvent<TimeInterval>(p_event, event_type_name.c_str());
61 template <
class TimeInterval>
63 const char *event_type_name)
68 convert2C<TimeInterval>(*p_event);
72 template <
class TimeInterval>
81 retval.
cpu_time_end = timing_event.timeEndCPU<TimeInterval>();
83 retval.
wall_time_end = timing_event.timeEndWall<TimeInterval>();
void addEventType(uint32_t event_type_id, const std::string &event_type_header, bool is_main_event=false)
Adds a new event type to the types of events.
static hebench::ReportGen::TimingReportEventC convert2C(const hebench::Common::TimingReportEvent &timing_event)
void addEvent(const TimingReportEventC &p_event)
#define MAX_TIME_REPORT_EVENT_DESCRIPTION_SIZE
std::uint64_t size
Size of underlying data.
Structure to contain flexible data.
uint64_t input_sample_count
int64_t time_interval_ratio_num
Scale of time interval used for this event.
uint32_t event_type_id
ID specifying the event type.
int64_t time_interval_ratio_den
Scale of time interval used for this event.
char description[MAX_TIME_REPORT_EVENT_DESCRIPTION_SIZE]
Description attached to this event.
void printArraysAsColumns(std::ostream &os, const hebench::APIBridge::NativeDataBuffer **p_buffers, std::size_t count, hebench::APIBridge::DataType data_type, bool output_row_index=false, const char *separator=" ")
Writes the collection of NativeDataBuffer as columns to the specified output stream.
std::uint64_t copyString(char *dst, std::uint64_t size, const std::string &src)
Copies a C++ string object into a C-style string.