Skip to content

Compilation error with submdspan in CUDA/HIP #367

@tpadioleau

Description

@tpadioleau

A minor typo produces a compilation error when calling submdspan from a layout_stride in CUDA or HIP. Here is an example with compiler explorer with nvcc <11.2.0.

The typo locates in the file submdspan_mapping.hpp, I would propose the following fix

diff --git a/include/experimental/__p2630_bits/submdspan_mapping.hpp b/include/experimental/__p2630_bits/submdspan_mapping.hpp
index 2a2cdf7..f32ffc4 100644
--- a/include/experimental/__p2630_bits/submdspan_mapping.hpp
+++ b/include/experimental/__p2630_bits/submdspan_mapping.hpp
@@ -608,7 +608,7 @@ layout_stride::mapping<Extents>::submdspan_mapping_impl(
     (defined(__NVCC__) &&                                                      \
      (__CUDACC_VER_MAJOR__ * 100 + __CUDACC_VER_MINOR__ * 10) < 1120)
                       MDSPAN_IMPL_STANDARD_NAMESPACE::detail::tuple<decltype(detail::stride_of(slices))...>(
-                          detail::stride_of(slices)...).values)),
+                          detail::stride_of(slices)...)).values),
 #else
                       MDSPAN_IMPL_STANDARD_NAMESPACE::detail::tuple(detail::stride_of(slices)...)).values),
 #endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions