Page MenuHomePhabricator

[OpenMP] Fix data-race in new device RTL

Authored by jhuber6 on Sep 23 2021, 2:23 PM.



This patch fixes a data-race observed when using the new device runtime
library. The Internal control variable for the parallel level is read in
the __kmpc_parallel_51 function while it could potentially be written
by other threads. This causes data corruption and will cause
nondetermistic behaviour in the runtime. This patch fixes this by adding
an explicit synchronization before the region starts.

Diff Detail

Event Timeline

jhuber6 created this revision.Sep 23 2021, 2:23 PM
jhuber6 requested review of this revision.Sep 23 2021, 2:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2021, 2:23 PM
This revision is now accepted and ready to land.Sep 23 2021, 2:27 PM
This revision was landed with ongoing or failed builds.Sep 23 2021, 2:28 PM
This revision was automatically updated to reflect the committed changes.