Change default benchmark filename

Signed-off-by: Trivernis <trivernis@protonmail.com>
main
Trivernis 4 years ago
parent ce819319c9
commit eacd852579
No known key found for this signature in database
GPG Key ID: EB543D89E02BC83F

@ -103,7 +103,20 @@ fn calculate_primes(
fn bench_local_size(opts: BenchLocalSize, mut controller: KernelController) -> OCLStreamResult<()> {
set_output_colored(opts.bench_options.general_options.color);
controller.set_concurrency(opts.bench_options.general_options.threads);
let bench_writer = open_write_buffered(&opts.bench_options.benchmark_file);
let bench_output = opts
.bench_options
.benchmark_file
.unwrap_or(PathBuf::from(format!(
"bench_local_{}-{}-{}_g{}_r{}_s{}_{}.csv",
opts.local_size_start,
opts.local_size_step,
opts.local_size_stop,
opts.global_size,
opts.bench_options.repetitions,
opts.bench_options.calculation_steps,
Local::now().format("%Y%m%d%H%M%S")
)));
let bench_writer = open_write_buffered(&bench_output);
let csv_writer = ThreadedCSVWriter::new(
bench_writer,
&[
@ -136,7 +149,20 @@ fn bench_global_size(
) -> OCLStreamResult<()> {
set_output_colored(opts.bench_options.general_options.color);
controller.set_concurrency(opts.bench_options.general_options.threads);
let bench_writer = open_write_buffered(&opts.bench_options.benchmark_file);
let bench_output = opts
.bench_options
.benchmark_file
.unwrap_or(PathBuf::from(format!(
"bench_global_{}-{}-{}_l{}_r{}_s{}_{}.csv",
opts.global_size_start,
opts.global_size_step,
opts.global_size_stop,
opts.local_size,
opts.bench_options.repetitions,
opts.bench_options.calculation_steps,
Local::now().format("%Y%m%d%H%M%S")
)));
let bench_writer = open_write_buffered(&bench_output);
let csv_writer = ThreadedCSVWriter::new(
bench_writer,
&[

@ -125,8 +125,8 @@ pub struct BenchOptions {
pub calculation_steps: u32,
/// The output file for timings
#[structopt(short = "o", long = "bench-output", default_value = "bench.csv")]
pub benchmark_file: PathBuf,
#[structopt(short = "o", long = "bench-output")]
pub benchmark_file: Option<PathBuf>,
/// The average of n runs that is used instead of using one value only.
/// By default the benchmark for each step is only run once

Loading…
Cancel
Save