summaryrefslogtreecommitdiff
path: root/SpMV/include/dfatool_host.ah
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2025-05-23 16:28:17 +0200
committerBirte Kristina Friesel <birte.friesel@uos.de>2025-05-23 16:28:35 +0200
commitfa6c70a44fc56cc50370e57c460dd61e8f127b51 (patch)
tree91269761966dccea80a2931542db5a3648f66e18 /SpMV/include/dfatool_host.ah
parent2e3a43c12df8115fc859248adb14b87e08becb77 (diff)
SpMV: Add AspectC++ support
Diffstat (limited to 'SpMV/include/dfatool_host.ah')
-rw-r--r--SpMV/include/dfatool_host.ah31
1 files changed, 31 insertions, 0 deletions
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 <sys/time.h>
+#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);
+ }
+};