This is an archive of the discontinued LLVM Phabricator instance.

[OPENMP][NVPTX]Fix parallel level counter in non-SPMD mode.
ClosedPublic

Authored by ABataev on Aug 27 2019, 7:27 AM.

Details

Summary

In non-SPMD mode we may end up with the divergent threads when trying to
increment/decrement parallel level counter. It may lead to incorrect
calculations of the parallel level and wrong results when threads are
divergent. We need to reconverge the threads before trying to modify the
parallel level counter.

Diff Detail

Repository
rL LLVM

Event Timeline

ABataev created this revision.Aug 27 2019, 7:27 AM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: guansong. · View Herald Transcript
jdoerfert accepted this revision.Sep 3 2019, 10:02 AM

You need to change the "type" of Mask and use the __kmpc_... call for ACTIVEMASK and SYNCWARP.

Other than that it looks good to me. (I really appreciate the description in the comment.)

This revision is now accepted and ready to land.Sep 3 2019, 10:02 AM

Looks good here. Apologies for the rebase induced by the recent patches to omptarget-nvptx.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 3 2019, 11:11 AM