Skip to content

Commit

Permalink
[CUDA] Place all CUDA sections in __NV_CUDA segment on Mac.
Browse files Browse the repository at this point in the history
That's where CUDA binaries appear to put them.

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

llvm-svn: 335880
  • Loading branch information
Artem-B committed Jun 28, 2018
1 parent c9d6752 commit 5ce0a08
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions clang/lib/CodeGen/CGCUDANV.cpp
Expand Up @@ -389,17 +389,19 @@ llvm::Function *CGNVCUDARuntime::makeModuleCtorFunction() {
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
Expand Down

0 comments on commit 5ce0a08

Please sign in to comment.