[PATCH] D52938: [CUDA] Use all 64 bits of GUID in __nv_module_id

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 5 10:44:28 PDT 2018


tra created this revision.
tra added a reviewer: Hahnfeld.
Herald added subscribers: bixia, jlebar, sanjoy.

getGUID() returns an uint64_t and "%x" only prints 32 bits of it.
Use PRIx64 format string to print all 64 bits.


https://reviews.llvm.org/D52938

Files:
  clang/lib/CodeGen/CGCUDANV.cpp


Index: clang/lib/CodeGen/CGCUDANV.cpp
===================================================================
--- clang/lib/CodeGen/CGCUDANV.cpp
+++ clang/lib/CodeGen/CGCUDANV.cpp
@@ -520,7 +520,7 @@
     // 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);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52938.168489.patch
Type: text/x-patch
Size: 581 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181005/ae51fc24/attachment.bin>


More information about the cfe-commits mailing list