-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Introduce aliasing for mdspan #3116
Introduce aliasing for mdspan #3116
Conversation
cea2909
to
980c06e
Compare
Other people will comment in more detail, but to me:
|
I think these symbols should go in dolfinx::common::mdspan then we can do a quick search and replace to std:: when that is possible. |
Further to @francesco-ballarin second point it might be better to have these aliases once in Basix. |
980c06e
to
94946dd
Compare
Moved all of the aliasing to namespace I understand that the same aliasing may be done in Shall I open an issue for the suggested |
94946dd
to
9b54d46
Compare
I think it would be better to have a namespace dolfinx::common::mdspan rather than sticking all of these in ::common. It would also make switching to std:: very easy. |
We will use std::mdspan as soon as it is widely available. |
Ah missed that you meant that as the full namespace identifier - will change. |
I don't think this is a good idea. We wouldn't change |
41fe7af
to
c69c0ae
Compare
No definitely one wouldn't change the vector aliasing, but only since its completely standardized by the required C++ version of the project. This does not apply for |
This new namespace includes the aliases associated to the mdspan type, naminlgy - mdspan - dextents - extents - full_extent - dynamic_extent - submdspan
c69c0ae
to
e87b4b5
Compare
I just took a look at what Kokkos is doing and their strategy for managing this (and eventually coexistence with other implementations) and I don't think we should try and be too clever, see e.g.: |
So, I guess the 3rd party style interaction for the |
I'm happy to revisit this when we get to the point of switching to the included |
This encapsulates the access to the
mdspan
functionality. This increases readability of code, as types are clearer and reduces the necessary changes to exchange the underlyingmdspan
implementation, for example after it becomes part of the STL.