[clang] [CUDA] Add device-side kernel launch support (PR #165519)

via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 25 08:40:19 PST 2025


================
@@ -503,6 +503,12 @@ RValue CodeGenFunction::EmitCXXOperatorMemberCallExpr(
 RValue CodeGenFunction::EmitCUDAKernelCallExpr(const CUDAKernelCallExpr *E,
                                                ReturnValueSlot ReturnValue,
                                                llvm::CallBase **CallOrInvoke) {
+  auto *FD = E->getConfig()->getDirectCallee();
+  // Emit as a device kernel call if the config is prepared using
+  // 'cudaGetParameterBuffer'.
+  if (FD && CGM.getContext().getcudaLaunchDeviceDecl() == FD)
----------------
darkbuck wrote:

revised by checking that we are generating CUDA device code.

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


More information about the cfe-commits mailing list