Skip to content

Commit 9983c33

Browse files
committed
Added an initialization that WAS needed.
1 parent 4f87bba commit 9983c33

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/gpuarray_reduction.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2599,6 +2599,12 @@ static void reduxGenSrcAppendDecode (GpuReduction* gr){
25992599
" TK1* restrict const W1R = &W1[GDIM_0*D];\n"
26002600
" TK1* restrict const SHMEMK1 = (TK1*)(SHMEM + SHMEMK1Off);\n");
26012601
}
2602+
srcbAppends(&gr->srcGen,
2603+
" INITREDUXSTATE(SHMEMK0[LID_0], SHMEMK1[LID_0]);\n"
2604+
" if(D<LDIM_0 && LID_0+LDIM_0<H){\n"
2605+
" INITREDUXSTATE(SHMEMK0[LID_0+LDIM_0], SHMEMK1[LID_0+LDIM_0]);\n"
2606+
" }\n"
2607+
" local_barrier();\n");
26022608
}
26032609

26042610

@@ -3502,9 +3508,7 @@ static int reduxInvInferProperties (redux_ctx* ctx){
35023508
}
35033509

35043510

3505-
return ctx->flags & 0 ? //FIXME: Delete this hack after debugging.
3506-
reduxInvFlattenSource (ctx):
3507-
reduxInvComputeKernelArgs(ctx);
3511+
return reduxInvFlattenSource(ctx);
35083512
}
35093513

35103514
/**

0 commit comments

Comments
 (0)