Style fix for enum.

This commit is contained in:
Allison Vacanti
2021-03-04 07:00:14 -05:00
parent a588af92fa
commit b562934a46
5 changed files with 23 additions and 23 deletions

View File

@@ -147,7 +147,7 @@ void measure_cold_base::generate_summaries()
if (m_cuda_noise > m_max_noise)
{
printer.log(nvbench::log_level::Warn,
printer.log(nvbench::log_level::warn,
fmt::format("Current measurement timed out ({:0.2f}s) "
"while over noise threshold ({:0.2f}% > "
"{:0.2f}%)",
@@ -157,7 +157,7 @@ void measure_cold_base::generate_summaries()
}
if (m_total_samples < m_min_samples)
{
printer.log(nvbench::log_level::Warn,
printer.log(nvbench::log_level::warn,
fmt::format("Current measurement timed out ({:0.2f}s) "
"before accumulating min_samples ({} < {})",
timeout,
@@ -166,7 +166,7 @@ void measure_cold_base::generate_summaries()
}
if (m_total_cuda_time < m_min_time)
{
printer.log(nvbench::log_level::Warn,
printer.log(nvbench::log_level::warn,
fmt::format("Current measurement timed out ({:0.2f}s) "
"before accumulating min_time ({:0.2f}s < "
"{:0.2f}s)",
@@ -177,7 +177,7 @@ void measure_cold_base::generate_summaries()
}
// Log to stdout:
printer.log(nvbench::log_level::Pass,
printer.log(nvbench::log_level::pass,
fmt::format("Cold: {:0.6f}ms GPU, {:0.6f}ms CPU, {:0.2f}s "
"total GPU, {}x",
avg_cuda_time * 1e3,

View File

@@ -102,7 +102,7 @@ void measure_hot_base::generate_summaries()
if (m_total_samples < m_min_samples)
{
printer.log(nvbench::log_level::Warn,
printer.log(nvbench::log_level::warn,
fmt::format("Current measurement timed out ({:0.2f}s) "
"before accumulating min_samples ({} < {})",
timeout,
@@ -111,7 +111,7 @@ void measure_hot_base::generate_summaries()
}
if (m_total_cuda_time < m_min_time)
{
printer.log(nvbench::log_level::Warn,
printer.log(nvbench::log_level::warn,
fmt::format("Current measurement timed out ({:0.2f}s) "
"before accumulating min_time ({:0.2f}s < "
"{:0.2f}s)",
@@ -122,7 +122,7 @@ void measure_hot_base::generate_summaries()
}
// Log to stdout:
printer.log(nvbench::log_level::Pass,
printer.log(nvbench::log_level::pass,
fmt::format("Batch: {:0.6f}ms GPU, {:0.2f}s total GPU, {}x",
avg_cuda_time * 1e3,
m_total_cuda_time,

View File

@@ -99,22 +99,22 @@ void markdown_printer::do_log(nvbench::log_level level, const std::string &msg)
std::string tag;
switch (level)
{
case log_level::Run:
case log_level::run:
tag = fmt::format(m_color ? run_color : no_style, "{:<5}", "Run:");
break;
case log_level::Pass:
case log_level::pass:
tag = fmt::format(m_color ? pass_color : no_style, "{:<5}", "Pass:");
break;
case log_level::Fail:
case log_level::fail:
tag = fmt::format(m_color ? fail_color : no_style, "{:<5}", "Fail:");
break;
case log_level::Skip:
case log_level::skip:
tag = fmt::format(m_color ? skip_color : no_style, "{:<5}", "Skip:");
break;
case log_level::Warn:
case log_level::warn:
tag = fmt::format(m_color ? warn_color : no_style, "{:<5}", "Warn:");
break;
case log_level::Info:
case log_level::info:
tag = fmt::format(m_color ? info_color : no_style, "{:<5}", "Info:");
break;
}
@@ -126,7 +126,7 @@ void markdown_printer::do_log(nvbench::log_level level, const std::string &msg)
void markdown_printer::do_log_run_state(const nvbench::state &exec_state)
{
this->log(nvbench::log_level::Run, exec_state.get_short_description(m_color));
this->log(nvbench::log_level::run, exec_state.get_short_description(m_color));
}
void markdown_printer::do_print_benchmark_list(

View File

@@ -13,12 +13,12 @@ struct state;
enum class log_level
{
Run,
Pass,
Fail,
Skip,
Warn,
Info
run,
pass,
fail,
skip,
warn,
info
};
/*!
@@ -71,7 +71,7 @@ struct printer_base
/*!
* Called before running the measurements associated with state.
* Implementations are expected to call `log(log_level::Run, ...)`.
* Implementations are expected to call `log(log_level::run, ...)`.
*/
void log_run_state(const nvbench::state &exec_state)
{

View File

@@ -34,7 +34,7 @@ void runner_base::handle_sampling_exception(const std::exception &e,
printer_opt_ref.has_value())
{
auto &printer = printer_opt_ref.value().get();
printer.log(nvbench::log_level::Fail, reason);
printer.log(nvbench::log_level::fail, reason);
}
exec_state.skip(reason);
@@ -58,7 +58,7 @@ void runner_base::print_skip_notification(state &exec_state) const
printer_opt_ref.has_value())
{
auto &printer = printer_opt_ref.value().get();
printer.log(nvbench::log_level::Skip, exec_state.get_skip_reason());
printer.log(nvbench::log_level::skip, exec_state.get_skip_reason());
}
}