[llvm] [Offload] Implement 'Vendor Name' device info for CUDA (PR #147334)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 7 08:59:42 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-offload

Author: Callum Fare (callumfare)

<details>
<summary>Changes</summary>

After #<!-- -->146345 the device info implementation requires a value for every query, rather than silently returning an empty string. This broke the test for `OL_DEVICE_INFO_VENDOR` on CUDA.

Add a value to the CUDA plugin. We can quite safely hard code this one.

---
Full diff: https://github.com/llvm/llvm-project/pull/147334.diff


1 Files Affected:

- (modified) offload/plugins-nextgen/cuda/src/rtl.cpp (+2) 


``````````diff
diff --git a/offload/plugins-nextgen/cuda/src/rtl.cpp b/offload/plugins-nextgen/cuda/src/rtl.cpp
index f1164074f9ea9..536a294f07ce3 100644
--- a/offload/plugins-nextgen/cuda/src/rtl.cpp
+++ b/offload/plugins-nextgen/cuda/src/rtl.cpp
@@ -940,6 +940,8 @@ struct CUDADeviceTy : public GenericDeviceTy {
     if (Res == CUDA_SUCCESS)
       Info.add("Device Name", TmpChar);
 
+    Info.add("Vendor Name", "NVIDIA");
+
     Res = cuDeviceTotalMem(&TmpSt, Device);
     if (Res == CUDA_SUCCESS)
       Info.add("Global Memory Size", TmpSt, "bytes");

``````````

</details>


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


More information about the llvm-commits mailing list