-
Notifications
You must be signed in to change notification settings - Fork 201
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
[FEA]: Use std::optional
instead of thrust::optional
#1464
[FEA]: Use std::optional
instead of thrust::optional
#1464
Conversation
We already require c++17, so there is no benefit on pulling in `thrust::optional` as a dependency.
I have added a set of deprecation warnings, that should ensure that we do not break c++ code explicitly passing |
Seems one of the tests failed with oom could someone rerun |
@miscco I triggered a rerun. |
@miscco is this ready to take out of draft? |
Oh yeah this should be fine to go |
std::optional
instead of thrust::optional
std::optional
instead of thrust::optional
python/rmm/_lib/memory_resource.pyx
Outdated
@@ -25,6 +25,7 @@ from libc.stddef cimport size_t | |||
from libc.stdint cimport int8_t, int64_t, uintptr_t | |||
from libcpp cimport bool | |||
from libcpp.memory cimport make_unique, unique_ptr | |||
from libcpp.optional cimport make_optional, optional |
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.
@miscco I pushed some changes here -- now that we're using the STL version, we don't need the extern
definition from Thrust at all. I did need to make a couple small tweaks (casting to size_t
) to make the libcpp.optional
work, though.
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.
😻
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.
Looks good to me. I pushed a few final changes to this PR and fixed up the Cython code. I'll let someone else decide whether/when to merge, since I was the last one to touch the code.
/merge |
Update `thrust::optional` to `std::optional` to align with rapidsai/rmm#1464. Authors: - Paul Taylor (https://github.com/trxcllnt) Approvers: - Corey J. Nolet (https://github.com/cjnolet) - Mark Harris (https://github.com/harrism) URL: #2199
We already require c++17, so there is no benefit on pulling in
thrust::optional
as a dependency.In addition thrust versiones its types with the cuda architecture, so using those types in API boundaries is not recommended.
This could be a potentially breaking change if a user would explicitly pass in
thrust::optional
into those APIs which seems unlikely