Struct quil_rs::program::scheduling::ScheduledBasicBlock
source · pub struct ScheduledBasicBlock<'a> { /* private fields */ }
Expand description
A ScheduledBasicBlock
is a wrapper around a BasicBlock
which includes a graph expressing the vector clock
among the instructions according to the Quil specification.
If instruction A blocks instruction B (because of shared use of a frame), then there will be an edge from A to B in the graph.
Implementations§
source§impl<'a> ScheduledBasicBlock<'a>
impl<'a> ScheduledBasicBlock<'a>
sourcepub fn build(
basic_block: BasicBlock<'a>,
program: &'a Program,
custom_handler: &mut InstructionHandler
) -> ScheduleResult<Self>
pub fn build( basic_block: BasicBlock<'a>, program: &'a Program, custom_handler: &mut InstructionHandler ) -> ScheduleResult<Self>
Build a scheduled basic block from a basic block and a program.
pub fn get_dependency_graph(&self) -> &DependencyGraph
pub fn instructions(&'a self) -> &[&'a Instruction]
sourcepub fn get_instruction(&self, node_id: usize) -> Option<&Instruction>
pub fn get_instruction(&self, node_id: usize) -> Option<&Instruction>
Return a particular-indexed instruction (if present).
pub fn label(&self) -> Option<&Target>
pub fn terminator(&self) -> &BasicBlockTerminator<'_>
pub fn basic_block(&self) -> &BasicBlock<'a>
source§impl<'p> ScheduledBasicBlock<'p>
impl<'p> ScheduledBasicBlock<'p>
sourcepub fn as_schedule_seconds(
&self,
program: &Program
) -> Result<ScheduleSeconds, ComputedScheduleError>
pub fn as_schedule_seconds( &self, program: &Program ) -> Result<ScheduleSeconds, ComputedScheduleError>
Compute the flattened schedule for this ScheduledBasicBlock
in terms of seconds,
using a default built-in calculation for the duration of scheduled instructions.
sourcepub fn as_schedule<F, TimeUnit: Clone + PartialOrd + Add<TimeUnit, Output = TimeUnit> + Zero>(
&self,
program: &'p Program,
get_duration: F
) -> Result<Schedule<TimeUnit>, ComputedScheduleError>
pub fn as_schedule<F, TimeUnit: Clone + PartialOrd + Add<TimeUnit, Output = TimeUnit> + Zero>( &self, program: &'p Program, get_duration: F ) -> Result<Schedule<TimeUnit>, ComputedScheduleError>
Compute the flattened schedule for this ScheduledBasicBlock
using a user-provided
closure for computation of instruction duration.
Return an error if the schedule cannot be computed from the information provided.
Trait Implementations§
source§impl<'a> Clone for ScheduledBasicBlock<'a>
impl<'a> Clone for ScheduledBasicBlock<'a>
source§fn clone(&self) -> ScheduledBasicBlock<'a>
fn clone(&self) -> ScheduledBasicBlock<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more