kokkos / mdspan

Reference implementation of mdspan targeting C++23
Other
417 stars 69 forks source link

Consider __make_dynamic_extent work-around for extents deduction guide #177

Closed mhoemmen closed 2 years ago

mhoemmen commented 2 years ago

@youyu3 encountered some issues compiling extents with nvcc + GCC with certain compiler versions and settings. The issue appears to be with __make_dynamic_extent(). Changing the extents(IndexTypes...) deduction guide so it looks like the following (not including constraints for clarity) makes it work.

template <class... IndexTypes>
extents(IndexTypes...) -> extents<size_t, size_t((IndexTypes(), -1))...>;

Should we consider doing this in the reference implementation as well, or at least doing this (if it works with nvcc)?

template <class... IndexTypes>
extents(IndexTypes...) -> extents<size_t, size_t((IndexTypes(), dynamic_extent))...>;