summaryrefslogtreecommitdiff
path: root/SpMV/support/common.h
diff options
context:
space:
mode:
authorJuan Gomez Luna <juan.gomez@safari.ethz.ch>2021-06-16 19:46:05 +0200
committerJuan Gomez Luna <juan.gomez@safari.ethz.ch>2021-06-16 19:46:05 +0200
commit3de4b495fb176eba9a0eb517a4ce05903cb67acb (patch)
treefc6776a94549d2d4039898f183dbbeb2ce013ba9 /SpMV/support/common.h
parentef5c3688c486b80a56d3c1cded25f2b2387f2668 (diff)
PrIM -- first commit
Diffstat (limited to 'SpMV/support/common.h')
-rw-r--r--SpMV/support/common.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/SpMV/support/common.h b/SpMV/support/common.h
new file mode 100644
index 0000000..58fede8
--- /dev/null
+++ b/SpMV/support/common.h
@@ -0,0 +1,25 @@
+
+/* Common data structures between host and DPUs */
+
+#ifndef _COMMON_H_
+#define _COMMON_H_
+
+#define ROUND_UP_TO_MULTIPLE_OF_2(x) ((((x) + 1)/2)*2)
+#define ROUND_UP_TO_MULTIPLE_OF_8(x) ((((x) + 7)/8)*8)
+
+struct DPUParams {
+ uint32_t dpuNumRows; /* Number of rows assigned to the DPU */
+ uint32_t dpuRowPtrsOffset; /* Offset of the row pointers */
+ uint32_t dpuRowPtrs_m;
+ uint32_t dpuNonzeros_m;
+ uint32_t dpuInVector_m;
+ uint32_t dpuOutVector_m;
+};
+
+struct Nonzero {
+ uint32_t col;
+ float value;
+};
+
+#endif
+