This is an archive of the discontinued LLVM Phabricator instance.

[libomptarget][nfc] Change enum values to match those in cuda/rtl
ClosedPublic

Authored by JonChesterfield on Feb 12 2020, 1:28 PM.

Details

Summary

[libomptarget][nfc] Change enum values to match those in cuda/rtl

support.h and cuda/rtl.cpp (and downsteam hsa/rtl.cpp) have enums for execution
mode. These are actually independent - the numbers that used within support, or
within the plugin, are never passed across the boundary.

Nevertheless, trying to work out why the values are different between the two
has generated a reasonable amount of confusion. This patch changes support to
match the values in plugin, on the basis that the plugin also has some comments
which I'd have to update if I changed that one instead. Credit to Ron for
working through this in our own fork. See rocm-developer-tools/aomp/issues/7
for that earlier diagnostic write up.

Also happy with generic = 0, spmd = 1 - provided it's the same in both places.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2020, 1:28 PM
grokos accepted this revision.Feb 12 2020, 1:42 PM

It's weird why the two values are the other way around in the nvptx runtime, whereas they are consistent between clang CodeGen and the CUDA plugin. I think the change is good, unless there is some specific reason for this difference.

This revision is now accepted and ready to land.Feb 12 2020, 1:42 PM

Yet another reason to start using a single source of truth, e.g., make all these enums in lib/Fontend/OpenMP/OMPConstants.h and include that file.

This revision was automatically updated to reflect the committed changes.