From 643e7dc59e8e0799f91ff74df56c52d7d4c10f12 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Thu, 15 May 2025 11:08:24 +0200 Subject: NW: AspectC++ support --- NW/host/app.c | 49 +++++++++++++++++++------------------------------ 1 file changed, 19 insertions(+), 30 deletions(-) (limited to 'NW/host') diff --git a/NW/host/app.c b/NW/host/app.c index 0e899ec..9de2918 100644 --- a/NW/host/app.c +++ b/NW/host/app.c @@ -7,20 +7,30 @@ #include #include #include + +#if ASPECTC +extern "C" { +#endif + #include #include -#include -#include -#include - -#include "../support/common.h" -#include "../support/timer.h" -#include "../support/params.h" #if ENERGY #include #endif +#if ASPECTC +} +#endif + +#include +#include +#include + +#include "common.h" +#include "timer.h" +#include "params.h" + // Define the DPU Binary path as DPU_BINARY here #ifndef DPU_BINARY #define DPU_BINARY "./bin/nw_dpu" @@ -184,7 +194,7 @@ int main(int argc, char **argv) { struct Params p = input_params(argc, argv); struct dpu_set_t dpu_set, dpu; - uint32_t nr_of_dpus, max_dpus; + uint32_t nr_of_dpus, nr_of_ranks, max_dpus; #if ENERGY struct dpu_probe_t probe; @@ -195,6 +205,7 @@ int main(int argc, char **argv) { DPU_ASSERT(dpu_alloc(NR_DPUS, NULL, &dpu_set)); DPU_ASSERT(dpu_load(dpu_set, DPU_BINARY, NULL)); DPU_ASSERT(dpu_get_nr_dpus(dpu_set, &nr_of_dpus)); + DPU_ASSERT(dpu_get_nr_ranks(dpu_set, &nr_of_ranks)); printf("Allocated %d DPU(s)\n", nr_of_dpus); printf("Allocated %d TASKLET(s) per DPU\n", NR_TASKLETS); #if DYNAMIC @@ -822,28 +833,6 @@ int main(int argc, char **argv) { stop(&timer, 1); } - - // Print timing results - printf("CPU version "); - print(&timer, 0, p.n_reps); - printf("CPU-DPU "); - print(&timer, 2, p.n_reps); - printf("DPU Kernel "); - print(&timer, 3, p.n_reps); - printf("Inter-DPU "); - print(&timer, 1, p.n_reps); - printf("DPU-CPU "); - print(&timer, 4, p.n_reps); - printf("\n"); - printf("Longest Diagonal CPU-DPU "); - print(&long_diagonal_timer, 2, p.n_reps); - printf("Longest Diagonal DPU Kernel "); - print(&long_diagonal_timer, 3, p.n_reps); - printf("Longest Diagonal Inter-DPU "); - print(&long_diagonal_timer, 1, p.n_reps); - printf("Longest Diagonal DPU-CPU "); - print(&long_diagonal_timer, 4, p.n_reps); - printf("\n"); #if ENERGY printf("DPU Energy (J): %f \t ", tavg_energy / p.n_reps); -- cgit v1.2.3