<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - __FLOAT128__ macro incorrectly defined for CUDA target"
   href="https://bugs.llvm.org/show_bug.cgi?id=47559">47559</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>__FLOAT128__ macro incorrectly defined for CUDA target
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>CUDA
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bugs-llvm@fabian-knorr.info
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The CUDA target does not support __float128, but Clang defines __FLOAT128__
regardless. This breaks feature detection in libstdc++, causing this trivial
invocation to fail:

<span class="quote">> /usr/bin/clang++ -x cuda --cuda-gpu-arch=sm_75 -c -std=gnu++17 /dev/null</span >
Output:

<span class="quote">> 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)</span >

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


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>