pub struct LaunchOptions {
pub mode: KernelMode,
pub grid_size: u32,
pub block_size: u32,
pub input_queue_capacity: usize,
pub output_queue_capacity: usize,
pub shared_memory_size: usize,
pub auto_activate: bool,
pub cooperative: bool,
pub enable_k2k: bool,
pub scheduler_config: Option<SchedulerConfig>,
}Expand description
Options for launching a kernel.
Fields§
§mode: KernelModeExecution mode (persistent or event-driven).
grid_size: u32Grid size (number of blocks).
block_size: u32Block size (threads per block).
input_queue_capacity: usizeInput queue capacity.
output_queue_capacity: usizeOutput queue capacity.
Shared memory size in bytes.
auto_activate: boolWhether to activate immediately after launch.
cooperative: boolEnable cooperative groups for grid-wide synchronization. Requires GPU support for cooperative kernel launch.
enable_k2k: boolEnable K2K (kernel-to-kernel) messaging. Allocates routing table and inbox buffers on GPU.
scheduler_config: Option<SchedulerConfig>Dynamic scheduling configuration for persistent actor load balancing.
When set to a non-Static strategy, the codegen layer generates a
scheduler warp pattern: warp 0 in each block handles work distribution,
remaining warps perform computation.
Default: None (static scheduling, current behavior).
Implementations§
Source§impl LaunchOptions
impl LaunchOptions
Sourcepub fn single_block(block_size: u32) -> Self
pub fn single_block(block_size: u32) -> Self
Create options for a single-block kernel.
Sourcepub fn multi_block(grid_size: u32, block_size: u32) -> Self
pub fn multi_block(grid_size: u32, block_size: u32) -> Self
Create options for a multi-block kernel.
Sourcepub fn with_mode(self, mode: KernelMode) -> Self
pub fn with_mode(self, mode: KernelMode) -> Self
Set execution mode.
Sourcepub fn with_queue_capacity(self, capacity: usize) -> Self
pub fn with_queue_capacity(self, capacity: usize) -> Self
Set queue capacities.
Set shared memory size.
Sourcepub fn without_auto_activate(self) -> Self
pub fn without_auto_activate(self) -> Self
Disable auto-activation.
Sourcepub fn with_grid_size(self, grid_size: u32) -> Self
pub fn with_grid_size(self, grid_size: u32) -> Self
Set the grid size (number of blocks).
Sourcepub fn with_block_size(self, block_size: u32) -> Self
pub fn with_block_size(self, block_size: u32) -> Self
Set the block size (threads per block).
Sourcepub fn with_cooperative(self, cooperative: bool) -> Self
pub fn with_cooperative(self, cooperative: bool) -> Self
Enable cooperative groups for grid-wide synchronization.
When enabled, the kernel will be launched cooperatively, allowing
all blocks to synchronize via grid.sync(). Requires GPU support
and nvcc at build time.
Sourcepub fn with_k2k(self, enable: bool) -> Self
pub fn with_k2k(self, enable: bool) -> Self
Enable K2K (kernel-to-kernel) messaging.
When enabled, allocates routing table and inbox buffers on GPU for direct kernel-to-kernel communication without host intervention.
Sourcepub fn with_scheduler(self, config: SchedulerConfig) -> Self
pub fn with_scheduler(self, config: SchedulerConfig) -> Self
Configure dynamic actor scheduling for load balancing.
When set, the codegen layer generates a scheduler warp pattern within each persistent kernel block. Warp 0 handles work distribution (stealing, round-robin, or priority-based), while remaining warps process messages.
§Example
use ringkernel_core::scheduling::SchedulerConfig;
let options = LaunchOptions::default()
.with_scheduler(SchedulerConfig::work_stealing(8)
.with_max_steal_batch(16));Sourcepub fn with_priority(self, _priority: u8) -> Self
pub fn with_priority(self, _priority: u8) -> Self
Set priority hint for kernel scheduling.
Note: This is a hint for future use - currently ignored by backends.
Sourcepub fn with_input_queue_capacity(self, capacity: usize) -> Self
pub fn with_input_queue_capacity(self, capacity: usize) -> Self
Set input queue capacity only.
Sourcepub fn with_output_queue_capacity(self, capacity: usize) -> Self
pub fn with_output_queue_capacity(self, capacity: usize) -> Self
Set output queue capacity only.
Trait Implementations§
Source§impl Clone for LaunchOptions
impl Clone for LaunchOptions
Source§fn clone(&self) -> LaunchOptions
fn clone(&self) -> LaunchOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more