From ce1e6a89d294507a21cc27bae1cba22a7af68a8c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 17 May 2023 14:49:41 +0200 Subject: port SCAN-SSA to dfatool --- SCAN-SSA/dpu/task.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'SCAN-SSA/dpu/task.c') 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); -- cgit v1.2.3