Skip to content

Commit

Permalink
add std::dims
Browse files Browse the repository at this point in the history
  • Loading branch information
fbusato committed Nov 25, 2024
1 parent 83d180f commit da1ffe0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/libcudacxx/standard_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,7 @@ Feature availability:

- C++23 ``<mdspan>`` is available in C++17.

- mdspan is feature complete in C++17 onwards.
- mdspan on msvc is only supported in C++20 and onwards.
- ``mdspan`` is feature complete in C++17 onwards.
- ``mdspan`` on msvc is only supported in C++20 and onwards.

- C++26 ``std::dims`` is available in C++17.
1 change: 1 addition & 0 deletions docs/libcudacxx/standard_api/container_library/mdspan.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Extensions
----------

- All features of ``<mdspan>`` are made available in C++17 onwards
- C++26 ``std::dims`` is made available in C++17 onwards

Restrictions
------------
Expand Down
3 changes: 3 additions & 0 deletions libcudacxx/include/cuda/std/__mdspan/extents.h
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,9 @@ struct __make_dextents<_IndexType, 0, _CUDA_VSTD::extents<_IndexType, _ExtentsPa
template <class _IndexType, size_t _Rank>
using dextents = typename __detail::__make_dextents<_IndexType, _Rank>::type;

template <size_t _Rank, class _IndexType = size_t>
using dims = dextents<_IndexType, _Rank>;

# if defined(__MDSPAN_USE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION)
template <class... _IndexTypes>
_CCCL_HOST_DEVICE extents(_IndexTypes...)
Expand Down

0 comments on commit da1ffe0

Please sign in to comment.