[clang] [CIR][CUDA] Support built-in CUDA surface type (PR #196079)

Orphic Dreamer via cfe-commits cfe-commits at lists.llvm.org
Sat May 23 01:09:34 PDT 2026


================
@@ -132,6 +130,12 @@ class NVPTXTargetCIRGenInfo : public TargetCIRGenInfo {
 public:
   NVPTXTargetCIRGenInfo(CIRGenTypes &cgt)
       : TargetCIRGenInfo(std::make_unique<NVPTXABIInfo>(cgt)) {}
+
+  mlir::Type getCUDADeviceBuiltinSurfaceDeviceType() const override {
+    // CUDA surface is represented as a 64-bit handle on device
+    return cir::IntType::get(&getABIInfo().cgt.getMLIRContext(), 64,
+                             /*isSigned=*/true);
+  }
 };
----------------
Siya-05 wrote:

Moved the NVPTX-specific CIR target implementation into `Targets/NVPTX.cpp` 

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


More information about the cfe-commits mailing list