Skip to content

__FLOAT128__ macro incorrectly defined for CUDA target #46903

Open
@llvmbot

Description

Bugzilla Link 47559
Version 10.0
OS Linux
Reporter LLVM Bugzilla Contributor
CC @Artem-B

Extended Description

The CUDA target does not support __float128, but Clang defines FLOAT128 regardless. This breaks feature detection in libstdc++, causing this trivial invocation to fail:

/usr/bin/clang++ -x cuda --cuda-gpu-arch=sm_75 -c -std=gnu++17 /dev/null
Output:

In file included from :1:
In file included from /usr/lib/clang/10.0.1/include/__clang_cuda_runtime_wrapper.h:36:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/cmath:47:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/std_abs.h:103:7: error: __float128 is not supported on this target
abs(__float128 __x)

It appears that there is a check missing in clang/lib/Basic/Targets/OSTargets.h, which should not set HasFloat128 when compiling for CUDA.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzillaconfirmedVerified by a second partycudafloating-pointFloating-point math

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions