[caffe2] Unblock caffe2_gpu under CUDA 13.3 (cudafe++ alias-decl reprint bug) (#194659)
Summary: A CUDA 13.3 NVCC front-end regression causes cudafe++ to mis‑print a namespace‑scope type alias in ATen, turning a size_t-like type into a reference to an out‑of‑scope symbol (BufferSizeVisitor), which then fails to compile. The workaround is to move the unsigned long vs uint32_t/uint64_t comparisons into an inline constexpr bool and use that in the alias, so cudafe++ no longer reconstructs the problematic type inside the alias declaration. This preserves behavior while avoiding the CUDA 13.3 re‑printer bug and restores successful builds under that CUDA version. Test Plan: Verified the generated `.cudafe1.cpp` now contains the correct condition rather than merely compiling, and confirmed with a `static_assert` that the alias still resolves to `_guarded_unsigned_long_unique_dummy` on LP64. Differential Revision: D117248107 Pull Request resolved: https://github.com/pytorch/pytorch/pull/194659 Approved by: https://github.com/eqy, https://github.com/lakshayg
G
Grace Cheng(Dev Infra) committed
fe4a613ec2a4d4652740f977fe27d9b875e980e4
Parent: 622b0e3
Committed by PyTorch MergeBot <pytorchmergebot@users.noreply.github.com>
on 8/25/2026, 1:41:50 AM