[libcu++] cuda_error: carry the exact status, its domain, and the source location #11825
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.40) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 283 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.338
Real PR Conversation Timeline
1 comments
"Review active on #11825"
general
weight: 0.35
andralex
Description
cuda::cuda_errorstores onecudaError_t. Driver failures are cast to it before being thrown, and statuses from other CUDA libraries (cuBLAS, cuFFT, ...) have no home at all, which is why cudax/stf keeps its owncuda_exceptiontype. This PR makescuda_errorable to carry any CUDA-family status exactly, so that one exception type can serve all of CCCL.What changes
holds<S>(),status<S>(),raw_code()(acuda::std::int64_t),status_type_name()andlocation().__cuda_status_traits/__cuda_status_defaults), not a customization point. libcu++ supplies text forcudaError_tandCUresult.CUresult, so a caught error can tell driver from runtime:__throw_if_failed(from #11933) throws theCUresult, andcuda_errorhas a constructor from the no-throw APIs'__driver_statusthat does the same.holds<cudaError_t>()andholds<int>()agree, and both are named"cudaError_t". ACUresultis named"CUresult".Backward compatibility
cuda_error(cudaError_t, msg, api, loc)andstatus()keep their signatures and meaning.status()on a driver status returns the same numeric conversion the wrappers always produced; on another library's status it returnscudaErrorUnknown.status<S>()gives the exact value.what()format changes fromfile:line api text(code): msgtofile:line api status_type(code): text: msg, so the status type is part of every message. Code that parseswhat()needs to follow.Tests:
libcudacxx/test/libcudacxx/cuda/ccclrt/utility/cuda_error.c2h.cucovers runtime, driver and other-library statuses, a struct status, the historical interface, and catching through the base class. Docs:docs/libcudacxx/extended_api/exceptions.rst.🤖 Generated with Claude Code