@@ -161,6 +161,14 @@ struct state
161161 void set_run_once (bool v) { m_run_once = v; }
162162 // / @}
163163
164+ // / If true, the batched measurements of benchmark are not run. This is intended for use to
165+ // / save resources when only non-batched measurements are of interest, although batched
166+ // / measurements are meaningful and code to exercise them is compiled. This option has no
167+ // / effect for CPU only benchmarks and for benchmarks tagged with no_batch tag. @{
168+ [[nodiscard]] bool get_skip_batched () const { return m_skip_batched; }
169+ void set_skip_batched (bool v) { m_skip_batched = v; }
170+ // / @}
171+
164172 // / If true, the benchmark does not use the blocking_kernel. This is intended
165173 // / for use with external profiling tools. @{
166174 [[nodiscard]] bool get_disable_blocking_kernel () const { return m_disable_blocking_kernel; }
@@ -298,6 +306,8 @@ private:
298306 std::optional<nvbench::device_info> device,
299307 std::size_t type_config_index);
300308
309+ [[nodiscard]] bool skip_hot_measurement () const { return get_run_once () || get_skip_batched (); }
310+
301311 std::reference_wrapper<const nvbench::benchmark_base> m_benchmark;
302312 nvbench::named_values m_axis_values;
303313 std::optional<nvbench::device_info> m_device;
@@ -306,6 +316,7 @@ private:
306316 bool m_is_cpu_only{false };
307317 bool m_run_once{false };
308318 bool m_disable_blocking_kernel{false };
319+ bool m_skip_batched{false };
309320
310321 nvbench::criterion_params m_criterion_params;
311322 std::string m_stopping_criterion;
0 commit comments