summaryrefslogtreecommitdiff
path: root/offload/plugins-nextgen/cuda/src/rtl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'offload/plugins-nextgen/cuda/src/rtl.cpp')
-rw-r--r--offload/plugins-nextgen/cuda/src/rtl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/offload/plugins-nextgen/cuda/src/rtl.cpp b/offload/plugins-nextgen/cuda/src/rtl.cpp
index db94f7f2dd99..a9adcc397fb7 100644
--- a/offload/plugins-nextgen/cuda/src/rtl.cpp
+++ b/offload/plugins-nextgen/cuda/src/rtl.cpp
@@ -25,6 +25,7 @@
#include "PluginInterface.h"
#include "Utils/ELF.h"
+#include "llvm/ADT/StringExtras.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Frontend/OpenMP/OMPConstants.h"
#include "llvm/Frontend/OpenMP/OMPGridValues.h"
@@ -293,6 +294,12 @@ struct CUDADeviceTy : public GenericDeviceTy {
if (auto Err = Plugin::check(Res, "error in cuDeviceGet: %s"))
return Err;
+ CUuuid UUID = {0};
+ Res = cuDeviceGetUuid(&UUID, Device);
+ if (auto Err = Plugin::check(Res, "error in cuDeviceGetUuid: %s"))
+ return Err;
+ setDeviceUidFromVendorUid(toHex(UUID.bytes, true));
+
// Query the current flags of the primary context and set its flags if
// it is inactive.
unsigned int FormerPrimaryCtxFlags = 0;