[QST] How to correctly Initialize a device-scope cuda::barrier? #5482
Replies: 2 comments 3 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
-
|
@osayamenja I believe that this is potentially dangerous. Conventionally barriers are put into shared memory and then initialized with the first thread that passes them. Depending on the constructors used, you could get some issues, because technically a To be fully correct you would need to allocate the space on device and then run a kernel to initialize the barrier on device with a single thread. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey experts,
I want to initialize a
cuda::barrier<cuda::thread_scope_device>object that would be visible to all threads in the grid.Is the code below valid?
I have used this logic elsewhere without any issues whatsoever, but I want to ensure I am not invoking undefined behavior by doing so 😅
Beta Was this translation helpful? Give feedback.
All reactions