summaryrefslogtreecommitdiff
path: root/SCAN-SSA/dpu/task.c
diff options
context:
space:
mode:
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);