diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2025-01-16 08:11:21 +0100 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2025-01-16 08:11:21 +0100 |
commit | 86bd03ef7598ca30649f99ba2d6b691d1d647e93 (patch) | |
tree | b735f100b8157534094a964033ad034385469b7f /COUNT/baselines/cpu/app_baseline.c | |
parent | 0b704b7ce9437e7769f561401518fc8320db37de (diff) |
COUNT: valgrind-ws support (WiP)
Diffstat (limited to 'COUNT/baselines/cpu/app_baseline.c')
-rw-r--r-- | COUNT/baselines/cpu/app_baseline.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/COUNT/baselines/cpu/app_baseline.c b/COUNT/baselines/cpu/app_baseline.c index d52257a..4e96276 100644 --- a/COUNT/baselines/cpu/app_baseline.c +++ b/COUNT/baselines/cpu/app_baseline.c @@ -12,7 +12,13 @@ #include <assert.h> #include <stdint.h> #include <omp.h> + +#if WITH_BENCHMARK #include "../../support/timer.h" +#else +#define start(...) +#define stop(...) +#endif #if NUMA #include <numaif.h> @@ -186,13 +192,22 @@ int main(int argc, char **argv) { // Create an input file with arbitrary data. create_test_file(file_size); +#if WITH_BENCHMARK Timer timer; +#endif + +#if NOP_SYNC + for(int rep = 0; rep < 200000; rep++) { + asm volatile("nop" ::); + } +#endif for(int rep = 0; rep < p.n_warmup + p.n_reps; rep++) { start(&timer, 0, 0); total_count = count_host(file_size, p.n_threads); stop(&timer, 0); +#if WITH_BENCHMARK unsigned int nr_threads = 0; #pragma omp parallel #pragma omp atomic @@ -213,8 +228,15 @@ int main(int argc, char **argv) { file_size / timer.time[0]); printall(&timer, 0); } +#endif // WITH_BENCHMARK } +#if NOP_SYNC + for(int rep = 0; rep < 200000; rep++) { + asm volatile("nop" ::); + } +#endif + #if NUMA numa_free(A, file_size * sizeof(T)); #else |