NVIDIA / cccl

CUDA Core Compute Libraries
https://nvidia.github.io/cccl/
Other
1.18k stars 144 forks source link

[BUG]: common_type regression from 2.4.0 to 2.5.0 #2013

Open cliffburdick opened 2 months ago

cliffburdick commented 2 months ago

Is this a duplicate?

Type of Bug

Compile-time Error

Component

libcu++

Describe the bug

The following code on 2.4.0 compiles:

      using out_t = cuda::std::common_type_t<cuda::std::complex<double>, cuda::std::complex<float>>;

In 2.5.0 this error is shown:

/repro/tmp/MatX/build/_deps/cccl-src/libcudacxx/lib/cmake/libcudacxx/../../../include/cuda/std/__type_traits/common_type.h(123): error: class "cuda::std::__4::common_type<cuda::std::__4::complex<double>, cuda::std::__4::complex<float>>" has no member "type"
  using common_type_t = typename common_type<_Tp...>::type;

How to Reproduce

https://godbolt.org/z/xxj1T7Gqa

Expected behavior

No compiler error.

Reproduction link

https://godbolt.org/z/xxj1T7Gqa

Operating System

Ubuntu 22.04

nvidia-smi output

No response

NVCC version

No response

cliffburdick commented 1 month ago

This still occurs in 2.6.0:

/repro/tmp/MatX/build/_deps/cccl-src/libcudacxx/lib/cmake/libcudacxx/../../../include/cuda/std/__type_traits/common_type.h(123): error: class "cuda::std::__4::common_type<cuda::std::__4::complex<double>, cuda::std::__4::complex<float>>" has no member "type"
  using common_type_t = typename common_type<_Tp...>::type;
                                                      ^
          detected during:
            instantiation of type "cuda::std::__4::common_type_t<cuda::std::__4::complex<double>, cuda::std::__4::complex<float>>" at line 52 of /repro/tmp/MatX/include/matx/operators/channelize_poly.h
            instantiation of class "matx::detail::ChannelizePolyOp<OpA, FilterType> [with OpA=matx::tensor_t<double, 1, matx::basic_storage<matx::raw_pointer_buffer<double, matx::matx_allocator<double>>>, matx::tensor_desc_t<cuda::std::__4::array<matx::index_t, 1UL>, cuda::std::__4::array<matx::index_t, 1UL>, 1>>, FilterType=matx::tensor_t<float, 1, matx::basic_storage<matx::raw_pointer_buffer<float, matx::matx_allocator<float>>>, matx::tensor_desc_t<cuda::std::__4::array<matx::index_t, 1UL>, cuda::std::__4::array<matx::index_t, 1UL>, 1>>]" at line 162 of /repro/tmp/MatX/include/matx/operators/channelize_poly.h
            instantiation of "auto matx::channelize_poly(const InType &, const FilterType &, matx::index_t, matx::index_t) [with InType=matx::tensor_t<double, 1, matx::basic_storage<matx::raw_pointer_buffer<double, matx::matx_allocator<double>>>, matx::tensor_desc_t<cuda::std::__4::array<matx::index_t, 1UL>, cuda::std::__4::array<matx::index_t, 1UL>, 1>>, FilterType=matx::tensor_t<float, 1, matx::basic_storage<matx::raw_pointer_buffer<float, matx::matx_allocator<float>>>, matx::tensor_desc_t<cuda::std::__4::array<matx::index_t, 1UL>, cuda::std::__4::array<matx::index_t, 1UL>, 1>>]" at line 215 of /repro/tmp/MatX/test/00_transform/ChannelizePoly.cu
jrhemstad commented 1 month ago

@cliffburdick reports that he is still seeing this issue.