diff --git a/SYCL/DeviceGlobal/device_global_device_only.cpp b/SYCL/DeviceGlobal/device_global_device_only.cpp index 87034d5dcf..a45ad3c27e 100644 --- a/SYCL/DeviceGlobal/device_global_device_only.cpp +++ b/SYCL/DeviceGlobal/device_global_device_only.cpp @@ -34,6 +34,8 @@ int main() { queue Q; Q.single_task([=]() { DeviceGlobalVar.get()[0] = 42; }); + // Make sure that the write happens before subsequent read + Q.wait(); int OutVal = 0; {