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

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 2 13:32:44 PDT 2019


yaxunl 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);
----------------
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?


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