Add memory resource control to valid_if - #23490
Draft
bdice wants to merge 1 commit into
Draft
Conversation
Teach cudf::detail::valid_if to accept cudf::memory_resources so the allocation roles inside the helper can be controlled independently. The returned validity mask now uses the output resource, while the device scalar used to accumulate the valid count uses the temporary resource. Replacing the former device_async_resource_ref parameter preserves existing source calls through memory_resources' implicit one-resource construction. Those callers retain the previous behavior: their supplied resource owns the returned mask and the current cuDF resource supplies temporary storage. Explicit two-resource callers can now avoid any fallback to global resource state. Add focused bitmask tests using the reusable memory-resource harness. The non-empty case installs an allocation-failing current resource, verifies output allocation lifetime, confirms temporary allocation activity and release, and validates the generated mask. The empty case proves the explicit two-resource path remains allocation-free and does not query the current resource. Validation performed: - ninja -C cpp/build/latest BITMASK_TEST - cpp/build/latest/gtests/BITMASK_TEST --gtest_filter='ValidIfTest.Explicit*' - test-cudf-cpp -R BITMASK_TEST - pre-commit run --all-files
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update
cudf::detail::valid_ifto acceptcudf::memory_resources. The returned validity mask uses the output resource, and its temporary valid-count scalar uses the temporary resource.This enables
cudf::label_bins, the pilot API for temporary memory-resource control, to propagate separate output and temporary resources through validity-mask construction without falling back to the current device resource.This is a non-breaking change for existing callers of
valid_if.Ref: #20780