5 #ifndef _HEBench_Harness_Report_CPP_H_0596d40a3cce4b108a81595c50eb286d
6 #define _HEBench_Harness_Report_CPP_H_0596d40a3cce4b108a81595c50eb286d
52 throw std::invalid_argument(
"Unknown prefix.");
77 throw std::invalid_argument(
"Unknown prefix.");
143 static constexpr
const char *m_private_class_name =
"TimingReport";
149 TimingReport(
const std::string &header = std::string());
155 void setHeader(
const std::string &new_header);
156 void appendHeader(
const std::string &new_header,
bool new_line =
true);
157 void prependHeader(
const std::string &new_header,
bool new_line =
true);
160 void setFooter(
const std::string &new_footer);
161 void appendFooter(
const std::string &new_header,
bool new_line =
true);
162 void prependFooter(
const std::string &new_header,
bool new_line =
true);
179 void addEventType(uint32_t event_type_id,
const std::string &event_type_header,
bool is_main_event =
false);
205 void save2CSV(
const std::string &filename);
211 template <
class TimeInterval = std::ratio<1, 1>>
213 template <
class TimeInterval = std::ratio<1, 1>>
220 template <
class TimeInterval>
225 / (
event.time_interval_ratio_den * TimeInterval::num);
228 template <
class TimeInterval>
233 / (
event.time_interval_ratio_den * TimeInterval::num);
static void setTimingPrefix(TimingPrefixedSeconds &prefix, double seconds, TimeUnit unit)
static constexpr TimeUnit getPrefix(char ch_prefix)
static void setTimingPrefix(TimingPrefixedSeconds &prefix, double seconds, char ch_prefix)
Converts the time in seconds to the specified time unit.
static constexpr char getPrefix(TimeUnit unit)
static void computeTimingPrefix(TimingPrefixedSeconds &prefix, double seconds)
Given a time interval in seconds, computes the timing prefix.
TimingReport & operator=(TimingReport &&)
bool hasEventType(uint32_t event_type_id) const
static TimingReport loadReportFromCSVFile(const std::string &filename)
void save2CSV(const std::string &filename)
static TimingReport loadReportFromCSV(const std::string &s_csv_content)
void setFooter(const std::string &new_footer)
uint32_t getMainEventType() const
friend class ReportSummary
std::string convert2CSV()
static double computeElapsedWallTime(const TimingReportEventC &event)
void addEvent(const TimingReportEventC &p_event)
std::string getFooter() const
void prependFooter(const std::string &new_header, bool new_line=true)
void setEventCapacity(uint64_t new_capacity)
uint64_t getEventTypeCount() const
void getEvent(TimingReportEventC &p_event, uint64_t index) const
void prependHeader(const std::string &new_header, bool new_line=true)
uint64_t getEventCount() const
uint64_t getEventCapacity() const
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.
std::string getHeader() const
std::string getEventTypeHeader(uint32_t event_type_id) const
void appendFooter(const std::string &new_header, bool new_line=true)
static double computeElapsedCPUTime(const TimingReportEventC &event)
uint32_t getEventType(uint64_t index) const
Retrieve an event type ID.
TimingReport(const TimingReport &)=delete
void setHeader(const std::string &new_header)
void appendHeader(const std::string &new_header, bool new_line=true)
int64_t time_interval_ratio_num
Scale of time interval used for this event.