[PATCH] D60141: [HIP-Clang] Fat binary should not be produced for non GPU code

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 2 13:46:59 PDT 2019


tra accepted this revision.
tra added inline comments.


================
Comment at: lib/CodeGen/CGCUDANV.cpp:475-476
     return nullptr;
+  if (IsHIP && EmittedKernels.empty() && DeviceVars.empty())
+    return nullptr;
   // void __{cuda|hip}_register_globals(void* handle);
----------------
yaxunl wrote:
> tra wrote:
> > I think this would make sense for CUDA, too. 
> https://github.com/llvm-mirror/clang/blob/master/lib/CodeGen/CGCUDANV.cpp#L482
> 
> CUDA generates a dummy register function call for -fgpu-rdc. So probably only do this when RelocatableDeviceCode is false for CUDA?
Good point. Off the top of my head I can't tell why -fcudardc needs this. Keeping the change HIP-only is fine.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60141/new/

https://reviews.llvm.org/D60141





More information about the cfe-commits mailing list