Summary
Introduce free-function GPU launch wrappers to centralise direct kernel launches and indirect GPU operations (library calls / composite ops), enabling optional instrumentation (timing, NVTX, error checking) configured statically at compile time.
Design doc: docs/design/gpu-launch-wrappers.md
Motivation
We want a single convention for submitting GPU work that:
- keeps call sites simple,
- avoids runtime overhead when instrumentation is disabled,
- enables optional profiling/logging/validation,
- supports both direct kernel launches and indirect "GPU ops".
Scope
In scope
- Free functions:
launch_kernel, launch_op
- Compile-time policy selection
- Optional instrumentation compiled out when disabled
- Nested launch wrapper calls are not allowed:
- Calling
launch_kernel or launch_op from within an active wrapper region is invalid.
- Must be detected (at least in debug builds).
Out of scope
- Mandatory enforcement (raw
<<<...>>> still allowed)
- Intercepting internal library kernel launches
- Runtime configuration
- CUDA Graph capture integration (for now)
Acceptance Criteria
Summary
Introduce free-function GPU launch wrappers to centralise direct kernel launches and indirect GPU operations (library calls / composite ops), enabling optional instrumentation (timing, NVTX, error checking) configured statically at compile time.
Design doc:
docs/design/gpu-launch-wrappers.mdMotivation
We want a single convention for submitting GPU work that:
Scope
In scope
launch_kernel,launch_oplaunch_kernelorlaunch_opfrom within an active wrapper region is invalid.Out of scope
<<<...>>>still allowed)Acceptance Criteria
launch_kernel()wraps kernel launcheslaunch_op()wraps indirect GPU work (e.g. cuBLAS/CUB calls or composite ops)