pub struct ExecutionPlanBuilder { /* private fields */ }Expand description
Builder for creating ExecutionPlan from schedule data.
Implementations§
Source§impl ExecutionPlanBuilder
impl ExecutionPlanBuilder
Sourcepub fn new(device: DeviceSpec) -> Self
pub fn new(device: DeviceSpec) -> Self
Create a new builder.
Sourcepub fn add_alias_ids(&mut self, ids: impl IntoIterator<Item = u64>)
pub fn add_alias_ids(&mut self, ids: impl IntoIterator<Item = u64>)
Add alias IDs that need cleanup.
Sourcepub fn add_buffer(&mut self, ast_id: u64, buffer: Buffer) -> usize
pub fn add_buffer(&mut self, ast_id: u64, buffer: Buffer) -> usize
Add a buffer to the plan. Returns the buffer index.
Sourcepub fn map_buffer(&mut self, ast_id: u64, idx: usize)
pub fn map_buffer(&mut self, ast_id: u64, idx: usize)
Map an additional AST/buffer UOp ID to an existing buffer index.
Sourcepub fn replace_buffer(&mut self, idx: usize, buffer: Buffer)
pub fn replace_buffer(&mut self, idx: usize, buffer: Buffer)
Replace a buffer at the given index (for BUFFER_VIEW sub-buffer views).
Sourcepub fn set_output_buffer(&mut self, idx: usize)
pub fn set_output_buffer(&mut self, idx: usize)
Set single output buffer index.
Sourcepub fn set_output_buffers(&mut self, indices: Vec<usize>)
pub fn set_output_buffers(&mut self, indices: Vec<usize>)
Set multiple output buffer indices (batch scheduling).
Sourcepub fn add_kernel(&mut self, kernel: PreparedKernel)
pub fn add_kernel(&mut self, kernel: PreparedKernel)
Compatibility helper: add a compiled kernel as a prepared operation.
The canonical builder path is add_op(PreparedOp::...).
Sourcepub fn add_op(&mut self, op: PreparedOp)
pub fn add_op(&mut self, op: PreparedOp)
Add a prepared operation in schedule order.
Sourcepub fn add_op_with_instance_dependencies(
&mut self,
op: PreparedOp,
instance_dependencies: Vec<usize>,
)
pub fn add_op_with_instance_dependencies( &mut self, op: PreparedOp, instance_dependencies: Vec<usize>, )
Add a prepared operation with concrete op-index dependencies.
Sourcepub fn build(self) -> Result<ExecutionPlan>
pub fn build(self) -> Result<ExecutionPlan>
Build the ExecutionPlan.
Finalizes by computing pre-allocated buffer pointers and buffer IDs for zero-allocation execution.
Auto Trait Implementations§
impl Freeze for ExecutionPlanBuilder
impl !RefUnwindSafe for ExecutionPlanBuilder
impl Send for ExecutionPlanBuilder
impl Sync for ExecutionPlanBuilder
impl Unpin for ExecutionPlanBuilder
impl UnsafeUnpin for ExecutionPlanBuilder
impl !UnwindSafe for ExecutionPlanBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more