[clang] [libclc] [libclc] Enable 64-bit atomics for nvptx64 (PR #213691)

Zheming Jin via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 3 20:06:10 PDT 2026


================
@@ -159,6 +159,13 @@ class LLVM_LIBRARY_VISIBILITY NVPTXTargetInfo : public TargetInfo {
     Opts["cl_khr_global_int32_extended_atomics"] = true;
     Opts["cl_khr_local_int32_base_atomics"] = true;
     Opts["cl_khr_local_int32_extended_atomics"] = true;
+    // PTX supports 64-bit atomics natively on 64-bit targets even though the
+    // NVIDIA OpenCL runtime does not report these extensions. libclc needs
----------------
zjin-lcf wrote:

Good catch, thanks for checking on real hardware. You are right — the claim came from the long-standing comment in intel/llvm, but your H100 `computeinfo` output shows current NVIDIA drivers do report both extensions. I have dropped that sentence; the comment now just explains that 64-bit atomics are natively supported where `MaxAtomicInlineWidth` is the target pointer width, and that libclc needs the extensions enabled to define the builtins.

https://github.com/llvm/llvm-project/pull/213691


More information about the cfe-commits mailing list