[llvm] [offload][cuda] Fix uid string handling (PR #227223)

Robert Imschweiler via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 01:56:47 PDT 2026


https://github.com/ro-i created https://github.com/llvm/llvm-project/pull/227223

Fixes https://github.com/llvm/llvm-project/issues/227094

>From c8c11b184105225fd2e492628a6abc3f17fd84b0 Mon Sep 17 00:00:00 2001
From: Robert Imschweiler <robert.imschweiler at amd.com>
Date: Tue, 29 Sep 2026 03:54:48 -0500
Subject: [PATCH] [offload][cuda] Fix uid string handling

Fixes https://github.com/llvm/llvm-project/issues/227094
---
 offload/plugins-nextgen/cuda/src/rtl.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/offload/plugins-nextgen/cuda/src/rtl.cpp b/offload/plugins-nextgen/cuda/src/rtl.cpp
index f349974763614..aabb48d0f7015 100644
--- a/offload/plugins-nextgen/cuda/src/rtl.cpp
+++ b/offload/plugins-nextgen/cuda/src/rtl.cpp
@@ -287,7 +287,8 @@ struct CUDADeviceTy : public GenericDeviceTy {
     Res = cuDeviceGetUuid(&UUID, Device);
     if (auto Err = Plugin::check(Res, "error in cuDeviceGetUuid: %s"))
       return Err;
-    setDeviceUidFromVendorUid(toHex(UUID.bytes, true));
+    setDeviceUidFromVendorUid(
+        toHex(StringRef(UUID.bytes, sizeof(UUID.bytes)), true));
 
     // Query the current flags of the primary context and set its flags if
     // it is inactive.



More information about the llvm-commits mailing list