[Mlir-commits] [mlir] [mlir][gpu] Add verification to disallow nested `gpu.launch` ops (PR #151968)

Guray Ozen llvmlistbot at llvm.org
Mon Aug 4 09:33:01 PDT 2025


grypp wrote:

Nested `gpu.launch` is valid IR, and we should not report an error in the target‑independent `gpu` dialect or during `gpu-kernel-outlining`.

For example, in CUDA supports nested kernel launch, it's called [dynamic parallelism](https://docs.nvidia.com/cuda/cuda-c-programming-guide/#parent-and-child-grids), which allows launching a kernel from within another kernel. A lowering for this could be implemented today.

However, since we currently don’t have such a lowering, we could emit an error in the `gpu-to-nvvm` pass (NVIDIA‑specific). Other vendors can add similar lowering or diagnostics in their respective passes.

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


More information about the Mlir-commits mailing list