From fa6c70a44fc56cc50370e57c460dd61e8f127b51 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 23 May 2025 16:28:17 +0200 Subject: SpMV: Add AspectC++ support --- SpMV/include/dfatool_host.ah | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 SpMV/include/dfatool_host.ah (limited to 'SpMV/include/dfatool_host.ah') diff --git a/SpMV/include/dfatool_host.ah b/SpMV/include/dfatool_host.ah new file mode 100644 index 0000000..91d44bd --- /dev/null +++ b/SpMV/include/dfatool_host.ah @@ -0,0 +1,31 @@ +#pragma once + +#include +#include "dfatool_host_dpu.ah" + +aspect DfatoolHostTiming : public DfatoolHostDPUTiming { + unsigned long n_rows, n_cols, n_nonzero; + unsigned int element_size; + + virtual int getKernel() { return 1; } + + DfatoolHostTiming() { + element_size = sizeof(float); + } + + advice call("% input_params(...)"): after() { + printf("[>>] SpMV | n_dpus=%u\n", NR_DPUS); + } + + advice call("% readCOOMatrix(...)") : after() { + struct COOMatrix* c = tjp->result(); + n_rows = c->numRows; + n_cols = c->numCols; + n_nonzero = c->numNonzeros; + printf("[--] SpMV | n_dpus=%u n_rows=%lu n_cols=%lu n_nonzero=%lu\n", NR_DPUS, n_rows, n_cols, n_nonzero); + } + + advice execution("% main(...)") : after() { + printf("[<<] SpMV | n_dpus=%u n_rows=%lu n_cols=%lu n_nonzero=%lu\n", NR_DPUS, n_rows, n_cols, n_nonzero); + } +}; -- cgit v1.2.3