This is an archive of the discontinued LLVM Phabricator instance.

CUDA/HIP: Allow __int128 on the host side

Authored by linjamaki on Oct 4 2021, 3:24 AM.



Consider case where __int128 type is supported by the host target but
not by a device target (e.g. spirv*). Clang emits an error message for
unsupported type even if the device code does not use it. This patch
fixes this issue by emitting the error message when the device code
attempts to use the unsupported type.

Diff Detail

Event Timeline

linjamaki created this revision.Oct 4 2021, 3:24 AM
linjamaki edited the summary of this revision. (Show Details)Oct 4 2021, 3:44 AM
linjamaki added a reviewer: rsmith.
linjamaki added subscribers: bader, Anastasia.
Herald added a project: Restricted Project. · View Herald Transcript
tra added a subscriber: tra.Oct 25 2021, 10:40 AM

LGTM. This could be useful for other types.
E.g. long double is technically not supported by NVPTX. We current demote it to double, so host-side does not cause errors, but ideally it should be treated similar to what you propose for i128 here.


Nit:I'd rephrase it a bit to make it a bit easier to understand (less negations).


Similarly, here I'd separate the check for i128 support by the target and the compilation mode check.

linjamaki updated this revision to Diff 382228.Oct 26 2021, 1:56 AM

Rephrase expressions.

Thanks for the review. Updated the patch with the style suggestions.

tra accepted this revision.Oct 26 2021, 12:48 PM
This revision is now accepted and ready to land.Oct 26 2021, 12:48 PM
linjamaki marked 2 inline comments as done.Nov 16 2021, 12:13 AM

This patch should be ready to land. @tra, could you please commit it to the LLVM for us? Thanks.

This revision was landed with ongoing or failed builds.Jan 4 2022, 4:10 PM
This revision was automatically updated to reflect the committed changes.