pub struct ParallelPass {
pub config: ParallelConfig,
pub regions: Vec<ParallelRegion>,
/* private fields */
}Expand description
The main parallelism optimisation pass.
Fields§
§config: ParallelConfigConfiguration.
regions: Vec<ParallelRegion>Regions identified during analysis.
Implementations§
Source§impl ParallelPass
impl ParallelPass
Sourcepub fn new(config: ParallelConfig) -> Self
pub fn new(config: ParallelConfig) -> Self
Create a new pass with the given configuration.
Sourcepub fn default_pass() -> Self
pub fn default_pass() -> Self
Create a pass with default configuration.
Sourcepub fn run(&mut self, decls: &mut [LcnfFunDecl])
pub fn run(&mut self, decls: &mut [LcnfFunDecl])
Run analysis + transformation over all function declarations.
Sourcepub fn analyze_parallelism(&mut self, decls: &[LcnfFunDecl])
pub fn analyze_parallelism(&mut self, decls: &[LcnfFunDecl])
Analyse all declarations and populate self.regions.
Sourcepub fn transform_to_parallel(&mut self, decls: &mut [LcnfFunDecl])
pub fn transform_to_parallel(&mut self, decls: &mut [LcnfFunDecl])
Transform declarations that have profitable parallel regions.
Currently adds an annotation to the function body (via LcnfExpr::Let
with a sentinel Ctor value) so that downstream code generators can
see the annotation. A full production implementation would rewrite the
loop body to use a parallel runtime API.
Sourcepub fn report(&self) -> ParallelReport
pub fn report(&self) -> ParallelReport
Produce a summary report of the pass results.
Auto Trait Implementations§
impl Freeze for ParallelPass
impl RefUnwindSafe for ParallelPass
impl Send for ParallelPass
impl Sync for ParallelPass
impl Unpin for ParallelPass
impl UnsafeUnpin for ParallelPass
impl UnwindSafe for ParallelPass
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