Skip to content
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

Merged
merged 8 commits into from
Feb 26, 2024

Conversation

miscco
Copy link
Contributor

@miscco miscco commented Feb 8, 2024

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

We already require c++17, so there is no benefit on pulling in `thrust::optional` as a dependency.
@miscco miscco requested review from a team as code owners February 8, 2024 10:16
@github-actions github-actions bot added Python Related to RMM Python API cpp Pertains to C++ code labels Feb 8, 2024
@miscco miscco added feature request New feature or request tech debt debt Internal clean up and improvements to reduce maintenance and technical debt in general breaking Breaking change improvement Improvement / enhancement to an existing function and removed Python Related to RMM Python API labels Feb 8, 2024
@github-actions github-actions bot added the Python Related to RMM Python API label Feb 8, 2024
@miscco miscco added non-breaking Non-breaking change and removed breaking Breaking change feature request New feature or request labels Feb 8, 2024
@miscco
Copy link
Contributor Author

miscco commented Feb 8, 2024

I have added a set of deprecation warnings, that should ensure that we do not break c++ code explicitly passing thrust::optional

@miscco
Copy link
Contributor Author

miscco commented Feb 15, 2024

Seems one of the tests failed with oom could someone rerun

@bdice
Copy link
Contributor

bdice commented Feb 15, 2024

@miscco I triggered a rerun.

@harrism
Copy link
Member

harrism commented Feb 20, 2024

@miscco is this ready to take out of draft?

@miscco
Copy link
Contributor Author

miscco commented Feb 20, 2024

Oh yeah this should be fine to go

@miscco miscco changed the title Draft: Use std::optional instead of thrust::optional [FEA]: Use std::optional instead of thrust::optional Feb 20, 2024
@@ -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
Copy link
Contributor

@bdice bdice Feb 23, 2024

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😻

Copy link
Contributor

@bdice bdice left a 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.

@harrism
Copy link
Member

harrism commented Feb 26, 2024

/merge

@rapids-bot rapids-bot bot merged commit c408a32 into rapidsai:branch-24.04 Feb 26, 2024
47 checks passed
trxcllnt added a commit to trxcllnt/raft that referenced this pull request Feb 26, 2024
rapids-bot bot pushed a commit to rapidsai/raft that referenced this pull request Feb 27, 2024
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
@miscco miscco deleted the replace_thrust_optional branch February 27, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cpp Pertains to C++ code improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Related to RMM Python API tech debt debt Internal clean up and improvements to reduce maintenance and technical debt in general
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants