libcudacxx
libcudacxx copied to clipboard
Port `std::span` and enable if for C++11 onwards to support mdspan
In addition to porting the span implementation from libc++ the PR does the following:
- Remove outdated support for
tupleinterface - Remove outdated support for
const_iterator - Change
index_typetosize_type
I intentionally did not adopt the ranges support, as that is out of scope.
Notably, this does not include any of the ranges work. We can only add that once we added ranges support.
It seems like there are more changes to the upstream implementation than I'm used to seeing for porting a header for libc++. Could you update the PR description with a summary of what needed to be changed?
Yeah, <span> underwent a ton of last minute changes. If I remember the last 3 standards meetings where quite loaded with changes. That involved:
- Removing tuple support
- Removing const_iterator support
- Changing index_type to size_type
- Ranges support
I intentionally did not adopt any ranges changes, as we do not have a ranges implementation working yet.
Yeah,
<span>underwent a ton of last minute changes.
Ah, so this is because our upstream copy of libc++ is a bit old. That makes more sense.
Would it be possible/sane to just checkout the span related files and tests from upstream libc++? Or is that effectively what you did?
Yeah,
<span>underwent a ton of last minute changes.Ah, so this is because our upstream copy of libc++ is a bit old. That makes more sense.
Would it be possible/sane to just checkout the
spanrelated files and tests from upstream libc++? Or is that effectively what you did?
Yes and no. I went ahead and ported all fixes that apply to us. However, the container interface has changed drastically due to ranges support, so it is not a 100% port.
Should we consider keeping a copy of the original libcxx tests in libcxx/test/std/...?
I think it's an important piece of coverage.
Should we consider keeping a copy of the original libcxx tests in
libcxx/test/std/...?I think it's an important piece of coverage.
I did not test the old tests, some of them will definitely fail, like those for the tuple interface.
So I guess we should either remove them or adopt them to the new state of things
I did not test the old tests, some of them will definitely fail, like those for the tuple interface. So I guess we should either remove them or adopt them to the new state of things
We could skip interfaces we don't support. 🤔
Need to update include/cuda/std/detail/libcxx/include/version and define __cpp_lib_span. Otherwise, this worked for my mdspan tests. Thanks!
Will run tests and merge if no issues occur.
Need to update
include/cuda/std/detail/libcxx/include/versionand define__cpp_lib_span. Otherwise, this worked for mymdspantests. Thanks!
Should that be addressed in this PR?
It should.