pub unsafe trait LaunchAsync<Params> {
// Required methods
unsafe fn launch(
self,
cfg: LaunchConfig,
params: Params,
) -> Result<(), DriverError>;
unsafe fn launch_on_stream(
self,
stream: &CudaStream,
cfg: LaunchConfig,
params: Params,
) -> Result<(), DriverError>;
unsafe fn launch_cooperative(
self,
cfg: LaunchConfig,
params: Params,
) -> Result<(), DriverError>;
}Expand description
Old cudarc-style launch trait reimplemented on top of CUDA 13-compatible raw kernel launches.
§Safety
Implementors must preserve CUDA’s launch semantics and must not let kernel parameter storage or referenced device memory expire before the launch is enqueued on the target stream.
Required Methods§
Sourceunsafe fn launch(
self,
cfg: LaunchConfig,
params: Params,
) -> Result<(), DriverError>
unsafe fn launch( self, cfg: LaunchConfig, params: Params, ) -> Result<(), DriverError>
Launch a kernel on the function’s default stream.
§Safety
params must match the underlying CUDA kernel ABI exactly, and all
referenced device pointers must stay valid until the launch is enqueued.
Sourceunsafe fn launch_on_stream(
self,
stream: &CudaStream,
cfg: LaunchConfig,
params: Params,
) -> Result<(), DriverError>
unsafe fn launch_on_stream( self, stream: &CudaStream, cfg: LaunchConfig, params: Params, ) -> Result<(), DriverError>
Launch a kernel on an explicit CUDA stream.
§Safety
The caller must uphold the same ABI and lifetime guarantees as launch
and must ensure stream is valid for the target device.
Sourceunsafe fn launch_cooperative(
self,
cfg: LaunchConfig,
params: Params,
) -> Result<(), DriverError>
unsafe fn launch_cooperative( self, cfg: LaunchConfig, params: Params, ) -> Result<(), DriverError>
Launch a cooperative kernel.
§Safety
The caller must uphold the same ABI and lifetime guarantees as launch
and must also ensure the kernel/configuration satisfies CUDA cooperative
launch requirements.