Skip to content

Commit

Permalink
kokkos#6805: make mdspan helpers namespace consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
nmm0 committed Mar 7, 2024
1 parent d60f30c commit c173db3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions core/src/Kokkos_View.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1758,16 +1758,18 @@ class View : public ViewTraits<DataType, Properties...> {
// MDSpan converting constructors
#ifdef KOKKOS_ENABLE_IMPL_MDSPAN
public:
template <typename U = typename Impl::MDSpanViewTraits<traits>::mdspan_type>
template <typename U = typename Experimental::Impl::MDSpanViewTraits<
traits>::mdspan_type>
KOKKOS_INLINE_FUNCTION MDSPAN_CONDITIONAL_EXPLICIT(traits::is_managed) View(
const typename Impl::MDSpanViewTraits<traits>::mdspan_type& mds,
std::enable_if_t<
!std::is_same_v<Impl::UnsupportedKokkosArrayLayout, U>>* = nullptr)
const typename Experimental::Impl::MDSpanViewTraits<traits>::mdspan_type&
mds,
std::enable_if_t<!std::is_same_v<
Experimental::Impl::UnsupportedKokkosArrayLayout, U>>* = nullptr)
: View(mds.data_handle(),
Experimental::Impl::array_layout_from_mapping<
typename traits::array_layout,
typename Impl::MDSpanViewTraits<traits>::mdspan_type>(
mds.mapping())) {}
typename Experimental::Impl::MDSpanViewTraits<
traits>::mdspan_type>(mds.mapping())) {}
#endif // KOKKOS_ENABLE_IMPL_MDSPAN
};

Expand Down
2 changes: 1 addition & 1 deletion core/unit_test/view/TestMDSpanConversion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct TestViewMDSpanConversion {
const MDSpanExtents &exts) {
using view_type = Kokkos::View<DataType, KokkosLayout,
Kokkos::MemoryTraits<Kokkos::Unmanaged>>;
using natural_mdspan_type = typename Kokkos::Impl::MDSpanViewTraits<typename view_type::traits>::mdspan_type;
using natural_mdspan_type = typename Kokkos::Experimental::Impl::MDSpanViewTraits<typename view_type::traits>::mdspan_type;
using mdspan_type = Kokkos::mdspan<value_type, MDSpanExtents, MDSpanLayout>;

static_assert(std::is_convertible_v<mdspan_type, natural_mdspan_type>);
Expand Down

0 comments on commit c173db3

Please sign in to comment.