Expand description
Async kernel launch with completion futures.
This module provides AsyncKernel for launching GPU kernels that
return Futures, enabling integration with Rust’s async/await
ecosystem without depending on any specific async runtime.
§Architecture
Since the OxiCUDA driver crate does not expose CUDA callback
registration, completion is detected by polling
Event::query(). The
PollStrategy enum controls how aggressively the future polls:
Spin— busy-poll with no yielding.Yield— callstd::thread::yield_now()between polls.BackoffMicros— sleep a fixed number of microseconds between polls.
§Example
let async_kernel = AsyncKernel::new(kernel);
let stream = Stream::new(&ctx)?;
let params = LaunchParams::new(4u32, 256u32);
// Fire-and-await
let completion = async_kernel.launch_async(¶ms, &stream, &(42u32,))?;
completion.await?;Structs§
- Async
Kernel - A kernel wrapper with async launch capability.
- Async
Launch Config - Configuration for async kernel launch behaviour.
- Launch
Completion - A
Futurethat resolves when a GPU kernel finishes execution. - Launch
Timing - Timing information for a completed kernel launch.
- Timed
Launch Completion - A
Futurethat resolves toLaunchTimingwhen a GPU kernel finishes, measuring elapsed GPU time via CUDA events.
Enums§
- Completion
Status - Status of a GPU kernel completion.
- Poll
Strategy - Strategy for polling GPU event completion.
Traits§
- Erased
Kernel Args - Object-safe trait for kernel arguments, enabling heterogeneous
argument lists in
multi_launch_async.
Functions§
- multi_
launch_ async - Launches multiple kernels on the same stream and returns a combined
LaunchCompletionfuture that resolves when all have finished.