Skip to content

Commit

Permalink
Add a bunch of local_barrier()'s.
Browse files Browse the repository at this point in the history
They are overkill but seem to fix the problems with the testcases, at
least so far.
  • Loading branch information
obilaniu committed Jul 24, 2017
1 parent 9983c33 commit 588b546
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 46 deletions.
3 changes: 3 additions & 0 deletions src/gpuarray_reduction.c
Original file line number Diff line number Diff line change
Expand Up @@ -2600,6 +2600,7 @@ static void reduxGenSrcAppendDecode (GpuReduction* gr){
" TK1* restrict const SHMEMK1 = (TK1*)(SHMEM + SHMEMK1Off);\n");
}
srcbAppends(&gr->srcGen,
" local_barrier();\n"
" INITREDUXSTATE(SHMEMK0[LID_0], SHMEMK1[LID_0]);\n"
" if(D<LDIM_0 && LID_0+LDIM_0<H){\n"
" INITREDUXSTATE(SHMEMK0[LID_0+LDIM_0], SHMEMK1[LID_0+LDIM_0]);\n"
Expand Down Expand Up @@ -2736,6 +2737,7 @@ static void reduxGenSrcAppendIncrement (GpuReduction* gr,
static void reduxGenSrcAppendDstWrite (GpuReduction* gr,
uint32_t selector,
int initial){
srcbAppends(&gr->srcGen, " local_barrier();\n");
if (initial){
srcbAppends(&gr->srcGen, " if(LID_0 < D){\n"
" SETREDUXSTATE(W0R[GID_0*D + LID_0],\n"
Expand All @@ -2762,6 +2764,7 @@ static void reduxGenSrcAppendDstWrite (GpuReduction* gr,
" }\n");
}
}
srcbAppends(&gr->srcGen, " local_barrier();\n");
}
static void reduxGenSrcAppendPhase1 (GpuReduction* gr){
/**
Expand Down
Loading

0 comments on commit 588b546

Please sign in to comment.