From 2b5662ea4a7d25ac66e88c9306baef565ffdb20f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Gro=C3=9Fe-Bley?= Date: Tue, 26 Apr 2022 13:40:46 +0200 Subject: [PATCH] Rename [get|set|m]_no_block to [get|set|m]_disable_blocking_kernel in public APIs --- nvbench/benchmark_base.cuh | 8 ++++---- nvbench/detail/measure_cold.cu | 2 +- nvbench/detail/state_exec.cuh | 2 +- nvbench/option_parser.cu | 2 +- nvbench/state.cuh | 6 +++--- nvbench/state.cxx | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/nvbench/benchmark_base.cuh b/nvbench/benchmark_base.cuh index 2b8a99a..3a16408 100644 --- a/nvbench/benchmark_base.cuh +++ b/nvbench/benchmark_base.cuh @@ -195,10 +195,10 @@ struct benchmark_base /// If true, the benchmark does not use the blocking_kernel. This is intended /// for use with external profiling tools. @{ - [[nodiscard]] bool get_no_block() const { return m_no_block; } - benchmark_base &set_no_block(bool v) + [[nodiscard]] bool get_disable_blocking_kernel() const { return m_disable_blocking_kernel; } + benchmark_base &set_disable_blocking_kernel(bool v) { - m_no_block = v; + m_disable_blocking_kernel = v; return *this; } /// @} @@ -266,7 +266,7 @@ protected: optional_ref m_printer; bool m_run_once{false}; - bool m_no_block{false}; + bool m_disable_blocking_kernel{false}; nvbench::int64_t m_min_samples{10}; nvbench::float64_t m_min_time{0.5}; diff --git a/nvbench/detail/measure_cold.cu b/nvbench/detail/measure_cold.cu index ea52f3f..380d2cd 100644 --- a/nvbench/detail/measure_cold.cu +++ b/nvbench/detail/measure_cold.cu @@ -41,7 +41,7 @@ measure_cold_base::measure_cold_base(state &exec_state) : m_state{exec_state} , m_launch{m_state.get_cuda_stream()} , m_run_once{exec_state.get_run_once()} - , m_no_block{exec_state.get_no_block()} + , m_no_block{exec_state.get_disable_blocking_kernel()} , m_min_samples{exec_state.get_min_samples()} , m_max_noise{exec_state.get_max_noise()} , m_min_time{exec_state.get_min_time()} diff --git a/nvbench/detail/state_exec.cuh b/nvbench/detail/state_exec.cuh index edc42d9..d323672 100644 --- a/nvbench/detail/state_exec.cuh +++ b/nvbench/detail/state_exec.cuh @@ -64,7 +64,7 @@ void state::exec(ExecTags tags, KernelLauncher &&kernel_launcher) return; } - if (!(modifier_tags & no_block) && this->get_no_block()) + if (!(modifier_tags & no_block) && this->get_disable_blocking_kernel()) { constexpr auto no_block_tags = modifier_tags | no_block; this->exec(no_block_tags, std::forward(kernel_launcher)); diff --git a/nvbench/option_parser.cu b/nvbench/option_parser.cu index c151896..55f7f1c 100644 --- a/nvbench/option_parser.cu +++ b/nvbench/option_parser.cu @@ -731,7 +731,7 @@ void option_parser::disable_blocking_kernel() } benchmark_base &bench = *m_benchmarks.back(); - bench.set_no_block(true); + bench.set_disable_blocking_kernel(true); } void option_parser::add_benchmark(const std::string &name) diff --git a/nvbench/state.cuh b/nvbench/state.cuh index f90cfe5..336ba2b 100644 --- a/nvbench/state.cuh +++ b/nvbench/state.cuh @@ -169,8 +169,8 @@ struct state /// If true, the benchmark does not use the blocking_kernel. This is intended /// for use with external profiling tools. @{ - [[nodiscard]] bool get_no_block() const { return m_no_block; } - void set_no_block(bool v) { m_no_block = v; } + [[nodiscard]] bool get_disable_blocking_kernel() const { return m_disable_blocking_kernel; } + void set_disable_blocking_kernel(bool v) { m_disable_blocking_kernel = v; } /// @} /// Accumulate at least this many seconds of timing data per measurement. @{ @@ -328,7 +328,7 @@ private: std::size_t m_type_config_index{}; bool m_run_once{false}; - bool m_no_block{false}; + bool m_disable_blocking_kernel{false}; nvbench::int64_t m_min_samples; nvbench::float64_t m_min_time; diff --git a/nvbench/state.cxx b/nvbench/state.cxx index ad02c23..0774faa 100644 --- a/nvbench/state.cxx +++ b/nvbench/state.cxx @@ -35,7 +35,7 @@ namespace nvbench state::state(const benchmark_base &bench) : m_benchmark{bench} , m_run_once{bench.get_run_once()} - , m_no_block{bench.get_no_block()} + , m_disable_blocking_kernel{bench.get_disable_blocking_kernel()} , m_min_samples{bench.get_min_samples()} , m_min_time{bench.get_min_time()} , m_max_noise{bench.get_max_noise()} @@ -52,7 +52,7 @@ state::state(const benchmark_base &bench, , m_device{std::move(device)} , m_type_config_index{type_config_index} , m_run_once{bench.get_run_once()} - , m_no_block{bench.get_no_block()} + , m_disable_blocking_kernel{bench.get_disable_blocking_kernel()} , m_min_samples{bench.get_min_samples()} , m_min_time{bench.get_min_time()} , m_max_noise{bench.get_max_noise()}