From 27d64923558c652684711372ad7edd12a32b8793 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk <21087696+oleksandr-pavlyk@users.noreply.github.com> Date: Mon, 2 Feb 2026 12:43:39 -0600 Subject: [PATCH] Factor out check for whether to skip hot measurement to a nvbench::state private method --- nvbench/detail/state_exec.cuh | 2 +- nvbench/state.cuh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/nvbench/detail/state_exec.cuh b/nvbench/detail/state_exec.cuh index 9a65fc2..0a01242 100644 --- a/nvbench/detail/state_exec.cuh +++ b/nvbench/detail/state_exec.cuh @@ -185,7 +185,7 @@ void state::exec(ExecTags tags, KernelLauncher &&kernel_launcher) static_assert(!(tags & no_batch), "Hot measurement doesn't support the `no_batch` exec_tag."); static_assert(!(tags & no_gpu), "Hot measurement doesn't support the `no_gpu` exec_tag."); - if (!this->get_run_once() && !this->get_skip_batched()) + if (!this->skip_hot_measurement()) { using measure_t = nvbench::detail::measure_hot; measure_t measure{*this, kernel_launcher}; diff --git a/nvbench/state.cuh b/nvbench/state.cuh index 326dc41..084324f 100644 --- a/nvbench/state.cuh +++ b/nvbench/state.cuh @@ -306,6 +306,8 @@ private: std::optional device, std::size_t type_config_index); + bool skip_hot_measurement() { return get_run_once() || get_skip_batched(); } + std::reference_wrapper m_benchmark; nvbench::named_values m_axis_values; std::optional m_device;