Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Fix issues in mdspan found on MSVC. #391

Merged
merged 8 commits into from
Mar 14, 2023
Merged

Fix issues in mdspan found on MSVC. #391

merged 8 commits into from
Mar 14, 2023

Conversation

wmaxey
Copy link
Member

@wmaxey wmaxey commented Mar 13, 2023

This marks all tests unsupported on MSVC && C++14/17.

Backports to C++20 are only blessed on MSVC 14.3X found in Visual Studio 2022.

@wmaxey wmaxey requested a review from miscco March 13, 2023 21:32
Copy link

@mhoemmen mhoemmen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes! : - D

@@ -208,7 +208,8 @@ class layout_left::mapping {
)
__MDSPAN_HOST_DEVICE
constexpr index_type operator()(_Indices... __idxs) const noexcept {
return __compute_offset(__rank_count<0, extents_type::rank()>(), __idxs...);
// Immediately cast incoming indices to `index_type`
return __compute_offset(__rank_count<0, extents_type::rank()>(), static_cast<index_type>(__idxs)...);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cast is a conforming implementation per http://eel.is/c++draft/mdspan.layout.left.obs .

@@ -451,7 +451,9 @@ struct layout_stride {
)
__MDSPAN_FORCE_INLINE_FUNCTION
constexpr index_type operator()(_Indices... __idxs) const noexcept {
return __impl::_call_op_impl(*this, static_cast<index_type>(__idxs)...);
// Should the op_impl operate in terms of `index_type` rather than `size_t`?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wmaxey wmaxey force-pushed the bugfix/mdspan_msvc branch from e72b52a to 04f160e Compare March 13, 2023 23:12
@miscco miscco added the testing: internal ci passed Passed internal NVIDIA CI (DVS). label Mar 14, 2023
@miscco miscco merged commit 0bfeb23 into main Mar 14, 2023
@miscco miscco deleted the bugfix/mdspan_msvc branch March 14, 2023 09:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
testing: internal ci passed Passed internal NVIDIA CI (DVS).
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants