Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dextents not available in std::experimental namespace #269

Open
mhoemmen opened this issue May 22, 2023 · 2 comments
Open

dextents not available in std::experimental namespace #269

mhoemmen opened this issue May 22, 2023 · 2 comments

Comments

@mhoemmen
Copy link
Contributor

dextents is not available in the std::experimental namespace (by default), even though mdspan and other mdspan components are. Instead, dextents can only be found in the std namespace by default.

Here is an example.

// does NOT compile
//template <typename T, size_t dimensions = 1>
//using slice0 = stdex::mdspan<T, stdex::dextents<size_t, dimensions>, std::experimental::layout_stride>;

// compiles
template <typename T, size_t dimensions = 1>
using slice1 = stdex::mdspan<T, std::dextents<size_t, dimensions>, std::experimental::layout_stride>;

// compiles
template <typename T, size_t dimensions = 1>
using slice2 = std::mdspan<T, std::dextents<size_t, dimensions>, std::layout_stride>;

One of my colleagues verified today that the problem exists in the headers, not just in the generated godbolt single header. The following code in the example

namespace MDSPAN_IMPL_STANDARD_NAMESPACE {
  inline constexpr int foobar = 42;
}

suggests what I think is the problem, namely that extents.hpp doesn't appear to import extents into the std namespace.

@nmm0
Copy link
Contributor

nmm0 commented May 25, 2023

Hmm... stdex::mdspan shouldn't compile, we might have a stray using declaration somewhere. All of the stuff merged into the standard should be under std:: or, better yet, Kokkos:: (include <mdspan/mdspan.hpp> for that namespace).

@shyun3
Copy link

shyun3 commented Oct 30, 2024

Just ran into this, the header does not have a using for dextents:

namespace MDSPAN_IMPL_STANDARD_NAMESPACE {
namespace MDSPAN_IMPL_PROPOSED_NAMESPACE {
using ::MDSPAN_IMPL_STANDARD_NAMESPACE::mdspan;
using ::MDSPAN_IMPL_STANDARD_NAMESPACE::extents;
using ::MDSPAN_IMPL_STANDARD_NAMESPACE::layout_left;
using ::MDSPAN_IMPL_STANDARD_NAMESPACE::layout_right;
using ::MDSPAN_IMPL_STANDARD_NAMESPACE::layout_stride;
using ::MDSPAN_IMPL_STANDARD_NAMESPACE::default_accessor;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants