You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Including this into a CUDA file (you don't even have to use the class in a device-side function or variable) leads to errors like ptxas fatal : Unresolved extern function '_Z31_Adjust_manually_vector_alignedv' or, when compiling with -fgpu-rdc, corresponding errors from nvlink. The resulting PTX contains unreferenced .weak .funcs of the defaulted virtual destructor. This bears some similarity to #98151, but the circumstances under which the extraneous symbol is emitted differ.
NVCC does not show this issue, it never generates .weak .func symbols for host-side destructors. Clang appears to only be generating these extraneous .weak .func symbols for code that exactly follows the above pattern; eliminating the templates, the virtual, the default, or the constexprs makes the problem go away.
The text was updated successfully, but these errors were encountered:
Consider the following bit of code:
Including this into a CUDA file (you don't even have to use the class in a device-side function or variable) leads to errors like
ptxas fatal : Unresolved extern function '_Z31_Adjust_manually_vector_alignedv'
or, when compiling with-fgpu-rdc
, corresponding errors fromnvlink
. The resulting PTX contains unreferenced.weak .func
s of the defaulted virtual destructor. This bears some similarity to #98151, but the circumstances under which the extraneous symbol is emitted differ.The code for
basic_string
and the functions it calls was reduced from https://github.com/microsoft/STL/blob/vs-2022-17.0/stl/inc/xstring and https://github.com/microsoft/STL/blob/vs-2022-17.0/stl/inc/xmemory. The current issue makes it impossible to usestd::string
in template classes with defaulted virtual destructors when using CUDA on Windows in C++20 mode.Godbolt: https://godbolt.org/z/7MTda4Kq4
NVCC does not show this issue, it never generates
.weak .func
symbols for host-side destructors. Clang appears to only be generating these extraneous.weak .func
symbols for code that exactly follows the above pattern; eliminating the templates, thevirtual
, thedefault
, or theconstexpr
s makes the problem go away.The text was updated successfully, but these errors were encountered: