From 6ae9be7d786ee46a88f7fa2ef86b2f09d7c831ad Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 25 May 2023 15:57:13 +0200 Subject: VA: re-add exp --- VA/baselines/cpu/app_baseline.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'VA/baselines/cpu/app_baseline.c') diff --git a/VA/baselines/cpu/app_baseline.c b/VA/baselines/cpu/app_baseline.c index b4396d2..3fdc10b 100644 --- a/VA/baselines/cpu/app_baseline.c +++ b/VA/baselines/cpu/app_baseline.c @@ -61,6 +61,7 @@ typedef struct Params { int input_size; int n_warmup; int n_reps; + int exp; int n_threads; }Params; @@ -73,6 +74,7 @@ void usage() { "\n -t # of threads (default=8)" "\n -w # of untimed warmup iterations (default=1)" "\n -e # of timed repetition iterations (default=3)" + "\n -x Weak (0) or strong (1) scaling (default=0)" "\n" "\nBenchmark-specific options:" "\n -i input size (default=8M elements)" @@ -84,10 +86,11 @@ struct Params input_params(int argc, char **argv) { p.input_size = 16777216; p.n_warmup = 1; p.n_reps = 3; + p.exp = 0; p.n_threads = 5; int opt; - while((opt = getopt(argc, argv, "hi:w:e:t:")) >= 0) { + while((opt = getopt(argc, argv, "hi:w:e:x:t:")) >= 0) { switch(opt) { case 'h': usage(); @@ -96,7 +99,8 @@ struct Params input_params(int argc, char **argv) { case 'i': p.input_size = atoi(optarg); break; case 'w': p.n_warmup = atoi(optarg); break; case 'e': p.n_reps = atoi(optarg); break; - case 't': p.n_threads = atoi(optarg); break; + case 'x': p.exp = atoi(optarg); break; + case 't': p.n_threads = atoi(optarg); break; default: fprintf(stderr, "\nUnrecognized option!\n"); usage(); @@ -115,7 +119,7 @@ int main(int argc, char **argv) { struct Params p = input_params(argc, argv); - const unsigned int file_size = p.input_size; + const unsigned int file_size = p.exp == 0 ? p.input_size * p.n_threads : p.input_size; // Create an input file with arbitrary data. create_test_file(file_size); -- cgit v1.2.3