[clang] [NFC][HIP] Disable device-side kernel launches for HIP (PR #171043)

via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 7 14:57:08 PST 2025


================
@@ -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)
----------------
darkbuck wrote:

We added sema check @ https://github.com/llvm/llvm-project/blob/8378a6fa4f5c83298fb0b5e240bb7f254f7b1137/clang/lib/Sema/SemaCUDA.cpp#L83 to generate error message on HIP based on Sam's request as HIP currently doesnt' support device-side kernel calls. I don't follow how we could have `CUDAKernelCallExpr` in the device compilation. Could you elaborate in details?

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


More information about the cfe-commits mailing list