fix(hipcub): restore deprecated thread operators and iterators for backward compatibility #16222
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 219 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.323
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #16222"
general
weight: 0.35
umfranzw
Motivation
hipCUB 3.1 removed some thread operators and iterator classes. Downstream code still uses them. E.g. TensorFlow will fail to build without these. This PR brings them back as deprecated wrappers.
Technical Details
Thread operators (
Max,Min,Sum,Difference,Division,Equality,Inequality,InequalityWrapper) are restored in the rocPRIM backend. Each one now derives from the matching libhipcxx functor, such aship::maximumorhip::std::plus.InequalityWrapperstores a caller functor, so it stays hand-written.The iterators (
hipcub::ConstantInputIterator,hipcub::CountingInputIterator,hipcub::TransformInputIterator,hipcub::DiscardOutputIterator) are restored for the rocPRIM backend. They are the original removed files, plus deprecation messages that point tohip::constant_iteratorand friends from libhipcxx. The CUB backend does not provide them, because CUB removed them in CCCL 3.0. There, an include gives a compile error that explains the migration path.Everything is gated behind
HIPCUB_USE_LEGACY_API. It is on by default. End users can define it as0to remove the legacy API. This follows the same pattern as #15388 (0de212e30ac8).A new test
hipcub.LegacyApicovers both groups.Test Plan
CI should pass with newly added test. The legacy API was also built locally with
-DHIPCUB_USE_LEGACY_API=0to check that all legacy symbols vanish.Test Result
Local tests build and uses the legacy API produces deprecation warnings. With
HIPCUB_USE_LEGACY_API=0, all legacy names are gone and hipCUB headers still compile.Submission Checklist