https://bugs.llvm.org/show_bug.cgi?id=47559

            Bug ID: 47559
           Summary: __FLOAT128__ macro incorrectly defined for CUDA target
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: CUDA
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

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 <built-in>: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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to