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 moreSource§impl<'a> Debug for ScheduledBasicBlock<'a>
impl<'a> Debug for ScheduledBasicBlock<'a>
Source§impl<'a> From<&'a ScheduledBasicBlockOwned> for ScheduledBasicBlock<'a>
impl<'a> From<&'a ScheduledBasicBlockOwned> for ScheduledBasicBlock<'a>
Source§fn from(block: &'a ScheduledBasicBlockOwned) -> Self
fn from(block: &'a ScheduledBasicBlockOwned) -> Self
Source§impl<'a> From<ScheduledBasicBlock<'a>> for ScheduledBasicBlockOwned
impl<'a> From<ScheduledBasicBlock<'a>> for ScheduledBasicBlockOwned
Source§fn from(block: ScheduledBasicBlock<'_>) -> Self
fn from(block: ScheduledBasicBlock<'_>) -> Self
Auto Trait Implementations§
impl<'a> Freeze for ScheduledBasicBlock<'a>
impl<'a> RefUnwindSafe for ScheduledBasicBlock<'a>
impl<'a> Send for ScheduledBasicBlock<'a>
impl<'a> Sync for ScheduledBasicBlock<'a>
impl<'a> Unpin for ScheduledBasicBlock<'a>
impl<'a> UnwindSafe for ScheduledBasicBlock<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.