-
Notifications
You must be signed in to change notification settings - Fork 69
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
configurable namespaces #253
Comments
One thing I wonder is whether we should make these namespaces implementation details? |
Another question I have is whether something which got design approved for our purposes should be treated as MDSPAN_DRAFT_NAMESPACE, e.g. submdspan. |
But yeah I think those 4 namespace categories and the names for the macros (+- an "IMPL") are good. |
Examples of stuff we will not propose could be things like |
@crtrott wrote:
It's pretty likely some user will want to control those macros, as a way to work around some conflicts between packages. |
@crtrott was concerned about not being able to define namespaces in a single line in C++ < 17. I do still recommend just assuming C++ >= 17. On the other hand, libcu++ deals with this issue with a few different macros. For example, in // redefine namespace std::
#undef _LIBCUDACXX_BEGIN_NAMESPACE_STD
#define _LIBCUDACXX_BEGIN_NAMESPACE_STD \
namespace cuda { namespace std { inline namespace _LIBCUDACXX_CUDA_ABI_NAMESPACE {
#undef _LIBCUDACXX_END_NAMESPACE_STD
#define _LIBCUDACXX_END_NAMESPACE_STD } } }
#undef _CUDA_VSTD
#define _CUDA_VSTD cuda::std::_LIBCUDACXX_CUDA_ABI_NAMESPACE where The reference implementation probably doesn't have to fuss about ABI versions, but libcxx likely does. |
I don't know that either |
I'm not sure if having |
I mean we could go radical and say the defaults are not std something at all. And we can add a cmake option to change the set of namespaces to std:: |
I honestly wouldn't mind that. After all, we aren't actually shipping as a standard library directly. Most of our use case will be as a TPL for Kokkos, even if it is nice to have some examples in |
or just the following, perhaps? #if ! defined(MDSPAN_PROPOSED_NAMESPACE)
# define MDSPAN_PROPOSED_NAMESPACE whatever_default
#endif |
Yeah I kinda was thinking that Mark, as the primary implementation thing. Its just the question whether we have a cmake option which defines those if you ask for it. |
…it's not under <experimental/*> unless using 'std' mode
…pace name. Also add some helper macros to make this easier
…ing the 'std-like' headers
…td`-like mode and `__cpp_lib_span` is defined. This prevents duplicate definitions with the standard library
…t instead. This avoids clashes when using the std headers
…r-CXX23 Fix C++23 build (GCC 13.1.0)
@crtrott mentioned that we want to be able to configure the namespace that is used for mdspan. We have a situation where mdspan is used as a fragment of a standard library and as a standalone library.
For example, in Kokkos, we may have both a mdspan header provided by the compiler and this mdspan library and we would have to avoid collisions.
We should allow configuring namespaces for:
std::mdspan
std
std::experimental
std::padded_layout*
std::experimental
mdspan
Please let me know if you have an opinions on these names
The text was updated successfully, but these errors were encountered: