[llvm] [Offload] Implement 'Vendor Name' device info for CUDA (PR #147334)
Callum Fare via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 7 08:59:05 PDT 2025
https://github.com/callumfare created https://github.com/llvm/llvm-project/pull/147334
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.
>From 6bb785f94655b364b2cc943b3c43ba50bad5140f Mon Sep 17 00:00:00 2001
From: Callum Fare <callum at codeplay.com>
Date: Wed, 2 Jul 2025 10:39:40 +0100
Subject: [PATCH] [Offload] Implement 'Vendor Name' device info for CUDA
---
offload/plugins-nextgen/cuda/src/rtl.cpp | 2 ++
1 file changed, 2 insertions(+)
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");
More information about the llvm-commits
mailing list