You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add const pointer overloads of unwrap_it for half-precision FP types - #12586
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Tests
Expanded numeric iterator coverage for standard integers and supported half-precision types.
Added checks that pointer unwrapping preserves pointer type, address, constness, and null values.
Added checks that constant-iterator unwrapping preserves values and offset types.
The change adds const-pointer unwrap_it overloads for half and bfloat16 wrappers. Tests check pointer conversions, null pointers, and constant-iterator values and offset types.
Changes: unwrap_it const-pointer support
Layer / File(s)
Summary
Half and bfloat16 const-pointer overloads cub/test/catch2_test_numeric_helpers.cuh
Added overloads that convert const half_t* to const __half* and const bfloat16_t* to const __nv_bfloat16*. The constant-iterator overloads now bind the wrapped and converted values as const.
Pointer and constant-iterator tests cub/test/catch2_test_numeric_helpers.cu
Added tests for pointer type, address, constness, and null preservation. Constant-iterator tests check unwrapped values and offset types across configured types.
Assessment against linked issues
Objective
Addressed
Explanation
Add unwrap_it const-pointer overloads for half-precision wrapper types [#12585]
✅
Possibly related PRs
NVIDIA/cccl#11374: Adds the original unwrap_it conversions for half and bfloat16 pointers and constant iterators.
NVIDIA/cccl#12260: Extracts the numeric helper header that contains the unwrap_it overloads.
Change: Feature · Severity of issue fixed: Medium
Merge Risk: Minimal · up to ddeeb
The pointer conversions and their tests have no identified merge-blocking issue.
Architecture risk: Low · up to ddeeb
The change affects 1 system.
Changed systems:cub
Architecture concerns
No architecture-level concerns identified.
Review details
Systems and components
observed — cub (service) was modified; 2 changed files map to changed impact.
Before / after behavior
observed — Modified behavior in cub/test/catch2_test_numeric_helpers.cu: Adds wrapped/unwrapped type pairs for int32_t and, when enabled by the test macros, half and bfloat16 types.
observed — Modified behavior in cub/test/catch2_test_numeric_helpers.cu: Adds pointer tests asserting that unwrap_it returns the corresponding unwrapped pointer type, preserves addresses and constness, and returns null for null pointers.
observed — Modified behavior in cub/test/catch2_test_numeric_helpers.cu: Adds constant-iterator tests across the configured wrapped types and int32_t/int64_t offsets, asserting the unwrapped iterator type retains its offset type and yields the original value at its base and offset positions.
observed — Modified behavior in cub/test/catch2_test_numeric_helpers.cuh: Added const-pointer unwrap_it overloads for half_t and bfloat16_t, returning pointers to the corresponding const CUDA types.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between 93ab9ca and ddeeb0c.
Files selected for processing: 1
cub/test/catch2_test_numeric_helpers.cuh
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
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
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.
Description
Add overloads to
catch2_test_numeric_helpers.cuhand add tests in a newcatch2_test_numeric_helpers.cutest file.closes #12585
Checklist