[llvm-bugs] [Bug 50505] -fno-cuda-host-device-constexpr not supported?

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 2 11:45:16 PDT 2021


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

Artem Belevich <tra at google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #5 from Artem Belevich <tra at google.com> ---
> Do you mean if I try to use STL in CUDA?

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.

> - NVCC - constexpr is not implicitly __host__ __device__, you need to opt-in  via an experimental flag: --expt-relaxed-constexpr

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.

https://godbolt.org/z/1GhdfMx84

I suspect that the root cause of your issues is not whether constexpr functions
are __host__ __device__.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210602/38748779/attachment.html>


More information about the llvm-bugs mailing list