summaryrefslogtreecommitdiff
path: root/SCAN-SSA/dpu/task.c
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2023-05-17 14:49:41 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2023-05-17 14:49:41 +0200
commitce1e6a89d294507a21cc27bae1cba22a7af68a8c (patch)
tree5b7660a5217fd89be0414a0818558d15a8580746 /SCAN-SSA/dpu/task.c
parent8a285f9058eae3dd9d832c5f76b1045cbb457782 (diff)
port SCAN-SSA to dfatool
Diffstat (limited to 'SCAN-SSA/dpu/task.c')
-rw-r--r--SCAN-SSA/dpu/task.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/SCAN-SSA/dpu/task.c b/SCAN-SSA/dpu/task.c
index c6871f7..15411a4 100644
--- a/SCAN-SSA/dpu/task.c
+++ b/SCAN-SSA/dpu/task.c
@@ -23,10 +23,16 @@ T message_partial_count;
// Scan in each tasklet
static T scan(T *output, T *input){
output[0] = input[0];
+#if UNROLL
#pragma unroll
for(unsigned int j = 1; j < REGS; j++) {
output[j] = output[j - 1] + input[j];
}
+#else
+ for(unsigned int j = 1; j < REGS; j++) {
+ output[j] = output[j - 1] + input[j];
+ }
+#endif
return output[REGS - 1];
}
@@ -53,10 +59,16 @@ BARRIER_INIT(my_barrier, NR_TASKLETS);
// Add in each tasklet
static void add(T *output, T p_count){
+#if UNROLL
#pragma unroll
for(unsigned int j = 0; j < REGS; j++) {
output[j] += p_count;
}
+#else
+ for(unsigned int j = 0; j < REGS; j++) {
+ output[j] += p_count;
+ }
+#endif
}
extern int main_kernel1(void);