Skip to content

Commit 7f8a62f

Browse files
authored
Add GLOBAL_MEM_FENCE to KA.__synchronize (#338)
KernelAbstractions (influenced by CUDA) states > After a `@synchronize` statement all read and writes to global and local memory > from each thread in the workgroup are visible in from all other threads in the > workgroup.
1 parent a75c773 commit 7f8a62f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/OpenCLKernels.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ end
165165
## Synchronization and Printing
166166

167167
@device_override @inline function KA.__synchronize()
168-
SPIRVIntrinsics.barrier(SPIRVIntrinsics.CLK_LOCAL_MEM_FENCE)
168+
SPIRVIntrinsics.barrier(SPIRVIntrinsics.CLK_LOCAL_MEM_FENCE | SPIRVIntrinsics.CLK_GLOBAL_MEM_FENCE)
169169
end
170170

171171
@device_override @inline function KA.__print(args...)

0 commit comments

Comments
 (0)