Yes, it will print the correct numbers. If you take a look at the ptx code, Compiler Explorer
it shows a global memory barrier (membar.gl) between writing the values and accessing the values.
The barrier disappears if grid.sync() is removed.
Yes, it will print the correct numbers. If you take a look at the ptx code, Compiler Explorer
it shows a global memory barrier (membar.gl) between writing the values and accessing the values.
The barrier disappears if grid.sync() is removed.