mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-03-14 20:27:24 +00:00
Merge pull request #254 from oleksandr-pavlyk/remove-cli-run-once-and-disable-blocking-kernel-options
Remove cli run-once and disable-blocking-kernel options
This commit is contained in:
@@ -108,21 +108,9 @@
|
||||
* Applies to the most recent `--benchmark`, or all benchmarks if specified
|
||||
before any `--benchmark` arguments.
|
||||
|
||||
* `--run-once`
|
||||
* Only run the benchmark once, skipping any warmup runs and batched
|
||||
measurements.
|
||||
* Intended for use with external profiling tools.
|
||||
* Applies to the most recent `--benchmark`, or all benchmarks if specified
|
||||
before any `--benchmark` arguments.
|
||||
|
||||
* `--disable-blocking-kernel`
|
||||
* Don't use the `blocking_kernel`.
|
||||
* Intended for use with external profiling tools.
|
||||
* Applies to the most recent `--benchmark`, or all benchmarks if specified
|
||||
before any `--benchmark` arguments.
|
||||
|
||||
* `--profile`
|
||||
* Implies `--run-once` and `--disable-blocking-kernel`.
|
||||
* Only run each benchmark once.
|
||||
* Disable any instrumentation that may interfere with profilers.
|
||||
* Intended for use with external profiling tools.
|
||||
* Applies to the most recent `--benchmark`, or all benchmarks if specified
|
||||
before any `--benchmark` arguments.
|
||||
|
||||
@@ -83,8 +83,8 @@ __global__ void block_stream(const volatile nvbench::int32_t *flag,
|
||||
"NVBench documentation.\n"
|
||||
"\n"
|
||||
"If this happens while profiling with an external tool,\n"
|
||||
"pass the `--disable-blocking-kernel` flag or the `--profile` flag\n"
|
||||
"(to also only run the benchmark once) to the executable.\n"
|
||||
"pass the `--profile` flag to the executable to disable use of blocking kernel\n"
|
||||
"and to also run the benchmark only once.\n"
|
||||
"\n"
|
||||
"For more information, see the 'Benchmark Properties' section of the\n"
|
||||
"NVBench documentation.\n\n",
|
||||
|
||||
@@ -456,26 +456,15 @@ void option_parser::parse_range(option_parser::arg_iterator_t first,
|
||||
this->lock_gpu_clocks(first[1]);
|
||||
first += 2;
|
||||
}
|
||||
else if (arg == "--run-once")
|
||||
{
|
||||
this->enable_run_once();
|
||||
first += 1;
|
||||
}
|
||||
else if (arg == "--stopping-criterion")
|
||||
{
|
||||
check_params(1);
|
||||
this->set_stopping_criterion(first[1]);
|
||||
first += 2;
|
||||
}
|
||||
else if (arg == "--disable-blocking-kernel")
|
||||
{
|
||||
this->disable_blocking_kernel();
|
||||
first += 1;
|
||||
}
|
||||
else if (arg == "--profile")
|
||||
{
|
||||
this->enable_run_once();
|
||||
this->disable_blocking_kernel();
|
||||
this->enable_profile();
|
||||
first += 1;
|
||||
}
|
||||
else if (arg == "--quiet" || arg == "-q")
|
||||
@@ -738,19 +727,6 @@ catch (std::exception &e)
|
||||
e.what());
|
||||
}
|
||||
|
||||
void option_parser::enable_run_once()
|
||||
{
|
||||
// If no active benchmark, save args as global.
|
||||
if (m_benchmarks.empty())
|
||||
{
|
||||
m_global_benchmark_args.push_back("--run-once");
|
||||
return;
|
||||
}
|
||||
|
||||
benchmark_base &bench = *m_benchmarks.back();
|
||||
bench.set_run_once(true);
|
||||
}
|
||||
|
||||
void option_parser::set_stopping_criterion(const std::string &criterion)
|
||||
try
|
||||
{
|
||||
@@ -773,17 +749,17 @@ catch (std::exception &e)
|
||||
e.what());
|
||||
}
|
||||
|
||||
void option_parser::disable_blocking_kernel()
|
||||
void option_parser::enable_profile()
|
||||
{
|
||||
// If no active benchmark, save args as global.
|
||||
// If no active benchmark, save args as global
|
||||
if (m_benchmarks.empty())
|
||||
{
|
||||
m_global_benchmark_args.push_back("--disable-blocking-kernel");
|
||||
m_global_benchmark_args.push_back("--profile");
|
||||
return;
|
||||
}
|
||||
|
||||
benchmark_base &bench = *m_benchmarks.back();
|
||||
bench.set_disable_blocking_kernel(true);
|
||||
bench.set_run_once(true);
|
||||
}
|
||||
|
||||
void option_parser::add_benchmark(const std::string &name)
|
||||
|
||||
@@ -88,8 +88,8 @@ private:
|
||||
void lock_gpu_clocks(const std::string &rate);
|
||||
|
||||
void set_stopping_criterion(const std::string &criterion);
|
||||
void enable_run_once();
|
||||
void disable_blocking_kernel();
|
||||
|
||||
void enable_profile();
|
||||
|
||||
void add_benchmark(const std::string &name);
|
||||
void replay_global_args();
|
||||
|
||||
@@ -31,8 +31,8 @@ set(test_srcs
|
||||
|
||||
# Custom arguments:
|
||||
# CTest commands+args can't be modified after creation, so we need to rely on substitution.
|
||||
set(NVBench_TEST_ARGS_nvbench.test.custom_main_custom_args "--quiet" "--my-custom-arg" "--run-once" "-d" "0")
|
||||
set(NVBench_TEST_ARGS_nvbench.test.custom_main_custom_exceptions "--quiet" "--run-once" "-d" "0")
|
||||
set(NVBench_TEST_ARGS_nvbench.test.custom_main_custom_args "--quiet" "--my-custom-arg" "--profile" "-d" "0")
|
||||
set(NVBench_TEST_ARGS_nvbench.test.custom_main_custom_exceptions "--quiet" "--profile" "-d" "0")
|
||||
|
||||
# Metatarget for all tests:
|
||||
add_custom_target(nvbench.test.all)
|
||||
|
||||
Reference in New Issue
Block a user