From e1430bd99f71196a0fba5e3edc72512b54628f7e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 22 Jun 2023 15:51:20 +0200 Subject: CPU-DPU: measure time for loading binary into dpu --- Microbenchmarks/CPU-DPU/support/params.h | 10 +++++++++- Microbenchmarks/CPU-DPU/support/timer.h | 6 +++--- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'Microbenchmarks/CPU-DPU/support') diff --git a/Microbenchmarks/CPU-DPU/support/params.h b/Microbenchmarks/CPU-DPU/support/params.h index 4618411..1ecf71d 100644 --- a/Microbenchmarks/CPU-DPU/support/params.h +++ b/Microbenchmarks/CPU-DPU/support/params.h @@ -5,6 +5,8 @@ typedef struct Params { unsigned int input_size; + unsigned int n_threads; + unsigned int n_nops; int n_warmup; int n_reps; int exp; @@ -22,24 +24,30 @@ static void usage() { "\n" "\nBenchmark-specific options:" "\n -i input size (default=8K elements)" + "\n -n number of threads per pool (default=8)" + "\n -N number of nops in dpu task (default=0)" "\n"); } struct Params input_params(int argc, char **argv) { struct Params p; p.input_size = 8 << 10; + p.n_threads = 8; + p.n_nops = 0; p.n_warmup = 1; p.n_reps = 3; p.exp = 0; int opt; - while((opt = getopt(argc, argv, "hi:w:e:x:")) >= 0) { + while((opt = getopt(argc, argv, "hi:n:w:e:x:N:")) >= 0) { switch(opt) { case 'h': usage(); exit(0); break; case 'i': p.input_size = atoi(optarg); break; + case 'n': p.n_threads = atoi(optarg); break; + case 'N': p.n_nops = atoi(optarg); break; case 'w': p.n_warmup = atoi(optarg); break; case 'e': p.n_reps = atoi(optarg); break; case 'x': p.exp = atoi(optarg); break; diff --git a/Microbenchmarks/CPU-DPU/support/timer.h b/Microbenchmarks/CPU-DPU/support/timer.h index eedc385..7c24f3b 100755 --- a/Microbenchmarks/CPU-DPU/support/timer.h +++ b/Microbenchmarks/CPU-DPU/support/timer.h @@ -37,9 +37,9 @@ typedef struct Timer{ - struct timeval startTime[4]; - struct timeval stopTime[4]; - double time[4]; + struct timeval startTime[10]; + struct timeval stopTime[10]; + double time[10]; }Timer; -- cgit v1.2.3