This is an archive of the discontinued LLVM Phabricator instance.

[libomptarget] Fix devicertl build
ClosedPublic

Authored by JonChesterfield on Mar 15 2021, 12:39 PM.

Details

Summary

[libomptarget] Fix devicertl build

The target specific functions in target_interface are extern C, but the
implementations for nvptx were mostly C++ mangling. That worked out as
a quirk of DEVICE macro expanding to nothing, except for shuffle.h which
only forward declared the functions with C++ linkage.

Also implements GetWarpSize, as used by shuffle, and includes target_interface
in nvptx target_impl.cu to help catch future divergence between interface and
implementation.

Diff Detail

Event Timeline

JonChesterfield requested review of this revision.Mar 15 2021, 12:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 15 2021, 12:39 PM
  • drop accidental amdgcn part
openmp/libomptarget/deviceRTLs/target_interface.h
28–32

These are 'extern' by default, but not 'EXTERN' which is a macro that expands to extern "C", which in this context seems confusing.

jdoerfert accepted this revision.Mar 15 2021, 12:43 PM

Assuming this unblocks the build, LG. We should clean up the extern mess though.

This revision is now accepted and ready to land.Mar 15 2021, 12:43 PM

Yep. Also, DEVICE now always expands to whitespace, so that can go.

This revision was landed with ongoing or failed builds.Mar 15 2021, 12:53 PM
This revision was automatically updated to reflect the committed changes.

Yep. Also, DEVICE now always expands to whitespace, so that can go.

Code for AMD platform is the only reason we still have DEVICE in common parts. ;-)

JonChesterfield added a comment.EditedMar 15 2021, 12:58 PM

Yep. Also, DEVICE now always expands to whitespace, so that can go.

Code for AMD platform is the only reason we still have DEVICE in common parts. ;-)

Your info is out of date, HIP build is no more. Patched at D98655