[HIP-Clang] Fat binary should not be produced for non GPU code
authorAaron Enye Shi <enye.shi@gmail.com>
Tue, 2 Apr 2019 21:54:41 +0000 (21:54 +0000)
committerAaron Enye Shi <enye.shi@gmail.com>
Tue, 2 Apr 2019 21:54:41 +0000 (21:54 +0000)
clang-format the changes to CUDA and HIP fat binary.

Reviewers: yaxunl, tra

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

llvm-svn: 357532

clang/lib/CodeGen/CGCUDANV.cpp

index 913d58e..42d2b15 100644 (file)
@@ -473,8 +473,8 @@ llvm::Function *CGNVCUDARuntime::makeModuleCtorFunction() {
   StringRef CudaGpuBinaryFileName = CGM.getCodeGenOpts().CudaGpuBinaryFileName;
   if (CudaGpuBinaryFileName.empty() && !IsHIP)
     return nullptr;
-  if ( (IsHIP || (IsCUDA && !RelocatableDeviceCode) )
-       && EmittedKernels.empty() && DeviceVars.empty())
+  if ((IsHIP || (IsCUDA && !RelocatableDeviceCode)) && EmittedKernels.empty() &&
+      DeviceVars.empty())
     return nullptr;
 
   // void __{cuda|hip}_register_globals(void* handle);