pub struct ParallelRegion {
pub func_name: String,
pub start_block: usize,
pub end_block: usize,
pub kind: ParallelKind,
pub pattern: ParallelPattern,
pub estimated_speedup: f64,
pub shared_vars: Vec<String>,
pub private_vars: Vec<String>,
pub trip_count: Option<u64>,
pub dependence_info: DependenceInfo,
}Expand description
A code region that has been identified as amenable to parallel execution.
Fields§
§func_name: StringName of the LCNF function that represents this region.
start_block: usizeIndex of the first basic block in the parallel body.
end_block: usizeIndex of the last basic block in the parallel body (inclusive).
kind: ParallelKindInferred parallel-execution model.
pattern: ParallelPatternSpecific algorithmic pattern detected.
estimated_speedup: f64Estimated parallel speed-up (ideal / Amdahl-limited).
Variables that are shared across parallel threads.
private_vars: Vec<String>Variables that are private to each parallel thread / iteration.
trip_count: Option<u64>Trip count of the parallel loop (if statically known).
dependence_info: DependenceInfoDependence analysis result for this region.
Implementations§
Source§impl ParallelRegion
impl ParallelRegion
Sourcepub fn new(
func_name: impl Into<String>,
kind: ParallelKind,
pattern: ParallelPattern,
) -> Self
pub fn new( func_name: impl Into<String>, kind: ParallelKind, pattern: ParallelPattern, ) -> Self
Create a minimal parallel region descriptor.
Sourcepub fn is_profitable(&self, threshold: f64) -> bool
pub fn is_profitable(&self, threshold: f64) -> bool
Whether this region is worth parallelising (speedup > threshold).
Trait Implementations§
Source§impl Clone for ParallelRegion
impl Clone for ParallelRegion
Source§fn clone(&self) -> ParallelRegion
fn clone(&self) -> ParallelRegion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParallelRegion
impl Debug for ParallelRegion
Auto Trait Implementations§
impl Freeze for ParallelRegion
impl RefUnwindSafe for ParallelRegion
impl Send for ParallelRegion
impl Sync for ParallelRegion
impl Unpin for ParallelRegion
impl UnsafeUnpin for ParallelRegion
impl UnwindSafe for ParallelRegion
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