Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit fc64e4e

Browse files
authored
[SYCL] Add wait to device_global_device_only to avoid race (#1254)
1 parent 7f2d049 commit fc64e4e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

SYCL/DeviceGlobal/device_global_device_only.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ int main() {
3434
queue Q;
3535

3636
Q.single_task([=]() { DeviceGlobalVar.get()[0] = 42; });
37+
// Make sure that the write happens before subsequent read
38+
Q.wait();
3739

3840
int OutVal = 0;
3941
{

0 commit comments

Comments
 (0)