Bug#1006962: nvidia-cuda-toolkit: nvcc chokes on g++ 11.2's bits/std_function.h

2022-10-04 Thread Andreas Beckmann
Followup-For: Bug #1006962
Control: fixed -1 11.6.1-1

This seems to be resolved in 11.6.1, except for some new problems in the
 header, but I'll ignore that (unless it also shows up in
some rdepends).

/usr/include/c++/11/coroutine:294:23: error: default member initializer for 
'std::__n4861::coroutine_handle::__frame::__r'
 required before the end of its enclosing class
  294 |   static __frame _S_fr;
  |   ^
/usr/include/c++/11/coroutine:289:26: note: defined here
  289 | void (*__r)() = __dummy_resume_destroy;
  |  ^~   
/usr/include/c++/11/coroutine:294:23: error: default member initializer for 
'std::__n4861::coroutine_handle::__frame::__d'
 required before the end of its enclosing class
  294 |   static __frame _S_fr;
  |   ^
/usr/include/c++/11/coroutine:290:26: note: defined here
  290 | void (*__d)() = __dummy_resume_destroy;
  |  ^~   
/usr/include/c++/11/coroutine:304:60: error: redefinition of 
'std::__n4861::coroutine_handle::__frame 
std::__n4861::coroutine_handle::_S_fr'
  304 |   noop_coroutine_handle::_S_fr{};
  |^

/usr/include/c++/11/coroutine:294:23: note: 
'std::__n4861::coroutine_handle::__frame 
std::__n4861::coroutine_handle::_S_fr' 
previously declared here
  294 |   static __frame _S_fr;
  |   ^


Andreas



Bug#1006962: nvidia-cuda-toolkit: nvcc chokes on g++ 11.2's bits/std_function.h

2022-05-23 Thread Andreas Beckmann

Control: severity -1 important

On Fri, 29 Apr 2022 01:56:49 +0200 Andreas Beckmann  wrote:

I'll probaby go back to gcc 10 for now ...


Did that in sid.

Andreas



Bug#1006962: nvidia-cuda-toolkit: nvcc chokes on g++ 11.2's bits/std_function.h

2022-04-28 Thread Andreas Beckmann

I'll probaby go back to gcc 10 for now ...



Bug#1006962: nvidia-cuda-toolkit: nvcc chokes on g++ 11.2's bits/std_function.h

2022-03-09 Thread Andreas Beckmann
Package: nvidia-cuda-toolkit
Version: 11.4.3-2
Severity: serious
Control: block 1003037 with -1

nvcc fails to compile bits/std_function.h from g++ 11.2:

$ echo '#include ' | nvcc -ccbin g++-11 -x cu -c -
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not 
expanded with ‘...’:
  435 | function(_Functor&& __f)
  | 
^ 
/usr/include/c++/11/bits/std_function.h:435:145: note: ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not 
expanded with ‘...’:
  530 | operator=(_Functor&& __f)
  | 
 ^ 
/usr/include/c++/11/bits/std_function.h:530:146: note: ‘_ArgTypes’

This is a regression from the header shipped with g++ 11.1
(11.2 includes a fix for an STL defect:
  "2774. std::function construction vs assignment")

The offending code can be reduced to

= nvcc-gcc112-failure.cu =
template < typename >
class function ;
template < typename >
class _Function_handler ;
template < typename _Res , typename ... _ArgTypes >
class function < _Res ( _ArgTypes... ) >
{
template < typename = void >
using _Handler = _Function_handler < _Res ( _ArgTypes... ) > ;
function
() noexcept ( _Handler < > :: template _S_nothrow_init < > ) ;
} ;
=

nvcc -v -x cu -c nvcc-gcc112-failure.cu yields these commands

g++-11 -D__CUDA_ARCH__=520 -E -x c++  -DCUDA_DOUBLE_MATH_FUNCTIONS -D__CUDACC__ 
-D__NVCC__   -D__CUDACC_VER_MAJOR__=11 -D__CUDACC_VER_MINOR__=4 
-D__CUDACC_VER_BUILD__=152 -D__CUDA_API_VER_MAJOR__=11 
-D__CUDA_API_VER_MINOR__=4 -include "cuda_runtime.h" -m64 
"nvcc-gcc112-failure.cu" -o 
"/tmp/tmpxft_7ddc_-7_nvcc-gcc112-failure.cpp1.ii" 
cicc --c++17 --gnu_version=110200 --orig_src_file_name "nvcc-gcc112-failure.cu" 
--allow_managed  -arch compute_52 -m64 --no-version-ident -ftz=0 -prec_div=1 
-prec_sqrt=1 -fmad=1 --include_file_name 
"tmpxft_7ddc_-3_nvcc-gcc112-failure.fatbin.c" -tused 
--gen_module_id_file --module_id_file_name 
"/tmp/tmpxft_7ddc_-4_nvcc-gcc112-failure.module_id" 
--gen_c_file_name 
"/tmp/tmpxft_7ddc_-6_nvcc-gcc112-failure.cudafe1.c" 
--stub_file_name 
"/tmp/tmpxft_7ddc_-6_nvcc-gcc112-failure.cudafe1.stub.c" 
--gen_device_file_name 
"/tmp/tmpxft_7ddc_-6_nvcc-gcc112-failure.cudafe1.gpu"  
"/tmp/tmpxft_7ddc_-7_nvcc-gcc112-failure.cpp1.ii" -o 
"/tmp/tmpxft_7ddc_-6_nvcc-gcc112-failure.ptx"
ptxas -arch=sm_52 -m64 
"/tmp/tmpxft_7ddc_-6_nvcc-gcc112-failure.ptx"  -o 
"/tmp/tmpxft_7ddc_-8_nvcc-gcc112-failure.sm_52.cubin" 
fatbinary -64 --cicc-cmdline="-ftz=0 -prec_div=1 -prec_sqrt=1 -fmad=1 " 
"--image3=kind=elf,sm=52,file=/tmp/tmpxft_7ddc_-8_nvcc-gcc112-failure.sm_52.cubin"
 
"--image3=kind=ptx,sm=52,file=/tmp/tmpxft_7ddc_-6_nvcc-gcc112-failure.ptx"
 
--embedded-fatbin="/tmp/tmpxft_7ddc_-3_nvcc-gcc112-failure.fatbin.c"
 
rm -f /tmp/tmpxft_7ddc_-3_nvcc-gcc112-failure.fatbin
g++-11 -E -x c++ -D__CUDACC__ -D__NVCC__   -D__CUDACC_VER_MAJOR__=11 
-D__CUDACC_VER_MINOR__=4 -D__CUDACC_VER_BUILD__=152 -D__CUDA_API_VER_MAJOR__=11 
-D__CUDA_API_VER_MINOR__=4 -include "cuda_runtime.h" -m64 
"nvcc-gcc112-failure.cu" -o 
"/tmp/tmpxft_7ddc_-5_nvcc-gcc112-failure.cpp4.ii" 
cudafe++ --c++17 --gnu_version=110200 --orig_src_file_name 
"nvcc-gcc112-failure.cu" --allow_managed --m64 --parse_templates 
--gen_c_file_name 
"/tmp/tmpxft_7ddc_-6_nvcc-gcc112-failure.cudafe1.cpp" 
--stub_file_name 
"tmpxft_7ddc_-6_nvcc-gcc112-failure.cudafe1.stub.c" 
--module_id_file_name 
"/tmp/tmpxft_7ddc_-4_nvcc-gcc112-failure.module_id" 
"/tmp/tmpxft_7ddc_-5_nvcc-gcc112-failure.cpp4.ii" 
g++-11 -D__CUDA_ARCH__=520 -c -x c++  -DCUDA_DOUBLE_MATH_FUNCTIONS -m64 
"/tmp/tmpxft_7ddc_-6_nvcc-gcc112-failure.cudafe1.cpp" -o 
"nvcc-gcc112-failure.o" 

the last g++-11 call is the failing one:

nvcc-gcc112-failure.cu:10:28: error: parameter packs not expanded with ‘...’:
   10 | function
  |^
 
nvcc-gcc112-failure.cu:10:28: note: ‘_ArgTypes’

Checking /tmp/tmpxft_7ddc_-6_nvcc-gcc112-failure.cudafe1.cpp
after rerunning the commands manually to preserve the temporary files,
the code has been rewritten by cudafe++ to

=
template< class > class function; 
template< class > class _Function_handler; 
template< class _Res, class ..._ArgTypes> 
class function< _Res (_ArgTypes ...)>  { 
template< class  = void> using _Handler = _Function_handler< _Res (_ArgTypes 
...)> ; 
function()