summaryrefslogtreecommitdiff
path: root/VA/baselines/cpu/app_baseline.c
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2023-05-25 15:57:13 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2023-05-25 15:57:13 +0200
commit6ae9be7d786ee46a88f7fa2ef86b2f09d7c831ad (patch)
treea7f11ae70e5bf59a49b6f32452b7bcef37b95800 /VA/baselines/cpu/app_baseline.c
parentf800d7f49beb23e3692469b5d8dbbc9a2bb846da (diff)
VA: re-add exp
Diffstat (limited to 'VA/baselines/cpu/app_baseline.c')
-rw-r--r--VA/baselines/cpu/app_baseline.c10
1 files changed, 7 insertions, 3 deletions
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 <T> # of threads (default=8)"
"\n -w <W> # of untimed warmup iterations (default=1)"
"\n -e <E> # of timed repetition iterations (default=3)"
+ "\n -x <X> Weak (0) or strong (1) scaling (default=0)"
"\n"
"\nBenchmark-specific options:"
"\n -i <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);