Skip to content
Snippets Groups Projects
Verified Commit d8aa1203 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

chore: better benchmark options

parent 1fd28828
No related branches found
No related tags found
1 merge request!24Performance optimisations
Pipeline #2835 passed
...@@ -44,11 +44,11 @@ pub struct Benchmark { ...@@ -44,11 +44,11 @@ pub struct Benchmark {
} }
impl Benchmark { impl Benchmark {
pub fn new(count: usize, cpu_only: Option<bool>, chunk_size: Option<usize>) -> Self { pub fn new(count: usize, chunk_size: Option<usize>, cpu_only: Option<bool>) -> Self {
Self { Self {
count, count,
cpu_only,
chunk_size, chunk_size,
cpu_only,
} }
} }
} }
...@@ -660,10 +660,17 @@ struct Args { ...@@ -660,10 +660,17 @@ struct Args {
default_value_t = 500000000, default_value_t = 500000000,
help = "The size of the benchmark in clock ticks" help = "The size of the benchmark in clock ticks"
)] )]
bench_count: usize, benchmark_count: usize,
#[arg(
long,
default_value_t = 1,
help = "The size of the benchmark in chunks"
)]
benchmark_chunk: usize,
#[arg(long, default_value_t = false, help = "Run benchmark only for the CPU")] #[arg(long, default_value_t = false, help = "Run benchmark only for the CPU")]
cpu_only: bool, benchmark_cpu: bool,
#[arg( #[arg(
long, long,
...@@ -736,7 +743,11 @@ fn main() { ...@@ -736,7 +743,11 @@ fn main() {
// not and runs it accordingly, note that if running in headless // not and runs it accordingly, note that if running in headless
// mode the number of cycles to be run may be specified // mode the number of cycles to be run may be specified
if args.benchmark { if args.benchmark {
emulator.run_benchmark(&Benchmark::new(args.bench_count, Some(args.cpu_only), None)); emulator.run_benchmark(&Benchmark::new(
args.benchmark_count,
Some(args.benchmark_chunk),
Some(args.benchmark_cpu),
));
} else if args.headless { } else if args.headless {
emulator.run_headless(if args.cycles > 0 { emulator.run_headless(if args.cycles > 0 {
Some(args.cycles) Some(args.cycles)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment