]> granicus.if.org Git - clang/commitdiff
[CUDA] Use all 64 bits of GUID in __nv_module_id
authorArtem Belevich <tra@google.com>
Fri, 5 Oct 2018 18:39:58 +0000 (18:39 +0000)
committerArtem Belevich <tra@google.com>
Fri, 5 Oct 2018 18:39:58 +0000 (18:39 +0000)
getGUID() returns an uint64_t and "%x" only prints 32 bits of it.
Use PRIx64 format string to print all 64 bits.

Differential Revision: https://reviews.llvm.org/D52938

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343875 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCUDANV.cpp

index d76076326e4661a7adee5667e6a6a04fb4fa9789..1c578bd151bdad990aa71de1bac737e4a807f562 100644 (file)
@@ -520,7 +520,7 @@ llvm::Function *CGNVCUDARuntime::makeModuleCtorFunction() {
     // Generate a unique module ID.
     SmallString<64> ModuleID;
     llvm::raw_svector_ostream OS(ModuleID);
-    OS << ModuleIDPrefix << llvm::format("%x", FatbinWrapper->getGUID());
+    OS << ModuleIDPrefix << llvm::format("%" PRIx64, FatbinWrapper->getGUID());
     llvm::Constant *ModuleIDConstant =
         makeConstantString(ModuleID.str(), "", ModuleIDSectionName, 32);