[PATCH] D48615: [CUDA] Place all CUDA sections in __NV_CUDA segment on Mac.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 28 10:20:45 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL335880: [CUDA] Place all CUDA sections in __NV_CUDA segment on Mac. (authored by tra, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D48615?vs=152979&id=153347#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D48615

Files:
  cfe/trunk/lib/CodeGen/CGCUDANV.cpp


Index: cfe/trunk/lib/CodeGen/CGCUDANV.cpp
===================================================================
--- cfe/trunk/lib/CodeGen/CGCUDANV.cpp
+++ cfe/trunk/lib/CodeGen/CGCUDANV.cpp
@@ -389,17 +389,19 @@
     FatMagic = HIPFatMagic;
   } else {
     if (RelocatableDeviceCode)
-      // TODO: Figure out how this is called on mac OS!
-      FatbinConstantName = "__nv_relfatbin";
+      FatbinConstantName = CGM.getTriple().isMacOSX()
+                               ? "__NV_CUDA,__nv_relfatbin"
+                               : "__nv_relfatbin";
     else
       FatbinConstantName =
           CGM.getTriple().isMacOSX() ? "__NV_CUDA,__nv_fatbin" : ".nv_fatbin";
     // NVIDIA's cuobjdump looks for fatbins in this section.
     FatbinSectionName =
         CGM.getTriple().isMacOSX() ? "__NV_CUDA,__fatbin" : ".nvFatBinSegment";
 
-    // TODO: Figure out how this is called on mac OS!
-    ModuleIDSectionName = "__nv_module_id";
+    ModuleIDSectionName = CGM.getTriple().isMacOSX()
+                              ? "__NV_CUDA,__nv_module_id"
+                              : "__nv_module_id";
     ModuleIDPrefix = "__nv_";
 
     // For CUDA, create a string literal containing the fat binary loaded from


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48615.153347.patch
Type: text/x-patch
Size: 1220 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180628/3b10fca6/attachment.bin>


More information about the cfe-commits mailing list