llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Alex Voicu (AlexVlx)

<details>
<summary>Changes</summary>

#<!-- -->165519 added support for launching kernels from the device side. This 
is only available in CUDA at the moment. We have to explicitly check whether we 
are compiling for HIP to guard against this path being exercised, since the 
CUDA and HIP languages rely on the same `CUDAIsDevice` bit to check for device 
side compilation, and it is not possible to disambiguate otherwise.

---
Full diff: https://github.com/llvm/llvm-project/pull/171043.diff


1 Files Affected:

- (modified) clang/lib/CodeGen/CGExprCXX.cpp (+2-1) 


``````````diff
diff --git a/clang/lib/CodeGen/CGExprCXX.cpp b/clang/lib/CodeGen/CGExprCXX.cpp
index ce2ed9026fa1f..3f4f61db8d3a4 100644
--- a/clang/lib/CodeGen/CGExprCXX.cpp
+++ b/clang/lib/CodeGen/CGExprCXX.cpp
@@ -504,7 +504,8 @@ RValue CodeGenFunction::EmitCUDAKernelCallExpr(const 
CUDAKernelCallExpr *E,
                                                ReturnValueSlot ReturnValue,
                                                llvm::CallBase **CallOrInvoke) {
   // Emit as a device kernel call if CUDA device code is to be generated.
-  if (getLangOpts().CUDAIsDevice)
+  // TODO: implement for HIP
+  if (!getLangOpts().HIP && getLangOpts().CUDAIsDevice)
     return CGM.getCUDARuntime().EmitCUDADeviceKernelCallExpr(
         *this, E, ReturnValue, CallOrInvoke);
   return CGM.getCUDARuntime().EmitCUDAKernelCallExpr(*this, E, ReturnValue,

``````````

</details>


https://github.com/llvm/llvm-project/pull/171043
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to