<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:tra@google.com" title="Artem Belevich <tra@google.com>"> <span class="fn">Artem Belevich</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - -fno-cuda-host-device-constexpr not supported?"
   href="https://bugs.llvm.org/show_bug.cgi?id=50505">bug 50505</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>WONTFIX
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - -fno-cuda-host-device-constexpr not supported?"
   href="https://bugs.llvm.org/show_bug.cgi?id=50505#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - -fno-cuda-host-device-constexpr not supported?"
   href="https://bugs.llvm.org/show_bug.cgi?id=50505">bug 50505</a>
              from <span class="vcard"><a class="email" href="mailto:tra@google.com" title="Artem Belevich <tra@google.com>"> <span class="fn">Artem Belevich</span></a>
</span></b>
        <pre><span class="quote">> Do you mean if I try to use STL in CUDA?</span >

Yes. Granted, it's a very limited subset that's usable on the GPU side, it
tends to grow as the standard library provides more constexpr APIs with new C++
versions.

<span class="quote">> - NVCC - constexpr is not implicitly __host__ __device__, you need to opt-in  via an experimental flag: --expt-relaxed-constexpr</span >

Your example is not compileable with NVCC as it does not allow attribute-based
overloading. Regardless of --expt-relaxed-constexpr NVCC reports that it can't
redefine the function.

<a href="https://godbolt.org/z/1GhdfMx84">https://godbolt.org/z/1GhdfMx84</a>

I suspect that the root cause of your issues is not whether constexpr functions
are __host__ __device__.</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>