-
Notifications
You must be signed in to change notification settings - Fork 187
Port std::span
and enable if for C++11 onwards to support mdspan
#313
Conversation
Notably, this does not include any of the ranges work. We can only add that once we added ranges support. |
14a9ba4
to
514600c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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,
I intentionally did not adopt any ranges changes, as we do not have a ranges implementation working yet. |
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 |
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 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 |
We could skip interfaces we don't support. 🤔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, but please address the two comments.
|
||
#if defined(_LIBCUDACXX_USE_PRAGMA_GCC_SYSTEM_HEADER) | ||
#pragma GCC system_header | ||
#endif | ||
|
||
_LIBCUDACXX_BEGIN_NAMESPACE_STD | ||
|
||
#if _LIBCUDACXX_STD_VER > 17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remember correctly, mdspan is C++14 only, so maybe we want to restrict this also to C++14?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I don't think we need to go through any efforts to backport this (or anything else) to C++11.
Need to update |
Will run tests and merge if no issues occur. |
Should that be addressed in this PR? |
It should. |
4b08898
to
0097f34
Compare
f917c15
to
45e6070
Compare
e021960
to
e68b1b9
Compare
// | ||
//===----------------------------------------------------------------------===// | ||
// UNSUPPORTED: c++03, c++11 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.fail tests do not yet support NVRTC.
// | ||
//===---------------------------------------------------------------------===// | ||
// UNSUPPORTED: c++03, c++11 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.verify tests probably also do not support NVRTC, but CI shows them passing somehow.
b6608b4
to
4c3bc98
Compare
Notably this does not take the fairly outdated state of our libc++ fork, but upgrades it to the actually approved state that became C++20. The only missing pieces are ranges support, but we can happily do that once we support ranges.
In addition to porting the span implementation from libc++ the PR does the following:
tuple
interfaceconst_iterator
index_type
tosize_type
I intentionally did not adopt the ranges support, as that is out of scope.