pub struct ExecutionGraph { /* private fields */ }Expand description
Execution graph representing a DAG of kernel operations.
The graph is built from a schedule and captures buffer dependencies between kernels. Independent kernels can be executed in parallel.
Implementations§
Source§impl ExecutionGraph
impl ExecutionGraph
Sourcepub fn add_node(&mut self, node: ExecutionNode)
pub fn add_node(&mut self, node: ExecutionNode)
Add a node to the graph.
Sourcepub fn node(&self, id: u64) -> Option<&ExecutionNode>
pub fn node(&self, id: u64) -> Option<&ExecutionNode>
Get a node by ID.
Sourcepub fn nodes(&self) -> impl Iterator<Item = &ExecutionNode>
pub fn nodes(&self) -> impl Iterator<Item = &ExecutionNode>
Get all nodes.
Sourcepub fn compute_parallel_groups(&mut self) -> Vec<Vec<u64>>
pub fn compute_parallel_groups(&mut self) -> Vec<Vec<u64>>
Compute topological order and find parallelizable groups.
Returns groups of nodes that can be executed in parallel. Each group contains nodes with no dependencies on each other.
Sourcepub fn device_groups(&self) -> &HashMap<DeviceSpec, Vec<u64>>
pub fn device_groups(&self) -> &HashMap<DeviceSpec, Vec<u64>>
Get nodes grouped by device.
Trait Implementations§
Source§impl Debug for ExecutionGraph
impl Debug for ExecutionGraph
Source§impl Default for ExecutionGraph
impl Default for ExecutionGraph
Source§fn default() -> ExecutionGraph
fn default() -> ExecutionGraph
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ExecutionGraph
impl RefUnwindSafe for ExecutionGraph
impl Send for ExecutionGraph
impl Sync for ExecutionGraph
impl Unpin for ExecutionGraph
impl UnsafeUnpin for ExecutionGraph
impl UnwindSafe for ExecutionGraph
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