Merge pull request #202 from alliepiper/misc-fixes

Misc fixes
This commit is contained in:
Allison Piper
2025-04-04 16:47:25 -04:00
committed by GitHub
5 changed files with 9 additions and 10 deletions

View File

@@ -195,7 +195,7 @@ struct benchmark_base
/// Specify the maximum amount of noise if a measurement supports noise.
/// Noise is the relative standard deviation:
/// `noise = stdev / mean_time`.
/// `noise = stdev / mean_time`.
/// Only applies to `stdrel` stopping criterion. @{
[[nodiscard]] nvbench::float64_t get_max_noise() const
{

View File

@@ -54,7 +54,7 @@ struct cuda_stream
/**
* Constructs a `cuda_stream` from an explicit cudaStream_t.
*
* @param owning If true, `cudaStreamCreate(stream)` will be called from this
* @param owning If true, `cudaStreamDestroy(stream)` will be called from this
* `cuda_stream`'s destructor.
*
* @sa nvbench::make_cuda_stream_view

View File

@@ -120,7 +120,7 @@ bool measure_cold_base::is_finished()
void measure_cold_base::run_trials_epilogue()
{
// Only need to compute this at the end, not per iteration.
const auto cpu_mean = m_total_cuda_time / static_cast<nvbench::float64_t>(m_total_samples);
const auto cpu_mean = m_total_cpu_time / static_cast<nvbench::float64_t>(m_total_samples);
const auto cpu_stdev = nvbench::detail::statistics::standard_deviation(m_cpu_times.cbegin(),
m_cpu_times.cend(),
cpu_mean);

View File

@@ -980,7 +980,7 @@ void option_parser::update_criterion_prop(
const std::string &prop_arg,
const std::string &prop_val,
const nvbench::named_values::type type)
try
try
{
// If no active benchmark, save args as global.
if (m_benchmarks.empty())
@@ -993,7 +993,7 @@ try
benchmark_base &bench = *m_benchmarks.back();
nvbench::criterion_params& criterion_params = bench.get_criterion_params();
std::string name(prop_arg.begin() + 2, prop_arg.end());
if (type == nvbench::named_values::type::float64)
if (type == nvbench::named_values::type::float64)
{
nvbench::float64_t value{};
::parse(prop_val, value);
@@ -1004,17 +1004,17 @@ try
}
criterion_params.set_float64(name, value);
}
else if (type == nvbench::named_values::type::int64)
else if (type == nvbench::named_values::type::int64)
{
nvbench::int64_t value{};
::parse(prop_val, value);
criterion_params.set_int64(name, value);
}
else if (type == nvbench::named_values::type::string)
else if (type == nvbench::named_values::type::string)
{
criterion_params.set_string(name, prop_val);
}
else
else
{
NVBENCH_THROW(std::runtime_error, "Unrecognized property: `{}`", prop_arg);
}

View File

@@ -147,7 +147,7 @@ struct state
void set_disable_blocking_kernel(bool v) { m_disable_blocking_kernel = v; }
/// @}
/// Accumulate at least this many seconds of timing data per measurement.
/// Accumulate at least this many seconds of timing data per measurement.
/// Only applies to `stdrel` stopping criterion. @{
[[nodiscard]] nvbench::float64_t get_min_time() const
{
@@ -296,7 +296,6 @@ private:
bool m_run_once{false};
bool m_disable_blocking_kernel{false};
nvbench::criterion_params m_criterion_params;
std::string m_stopping_criterion;