stdlib/parallelView source ↗
parallel
10 items · generated by scribe fromstdlib/parallel.fd· synced 2026-11-15
Contents
- par_map (function)
- par_sum (function)
- par_dot (function)
- par_fill (function)
- par_range (function)
- is_parallelizable (function)
- parallel_hint (function)
par_map
Parallel map: apply a function to each element of a Vec. Currently sequential — parallel write to a shared result Vec requires finer-grained synchronization. Each element is independent.
pub fn par_map(n: i64) -> Vec<i64> {Parameters:
n:i64
Returns: Vec<i64>
Defined at line 59
par_sum
Parallel sum: compute the sum of a Vec. For large inputs (>= PAR_THRESHOLD), splits into 2 chunks processed by separate OS threads. For small inputs, runs sequentially.
pub fn par_sum(data: Vec<i64>) -> i64 {Parameters:
data:Vec<i64>
Returns: i64
Defined at line 72
par_dot
Parallel dot product: compute the dot product of two Vecs. For large inputs (>= PAR_THRESHOLD), splits into 2 chunks processed by separate OS threads. For small inputs, runs sequentially.
pub fn par_dot(a: Vec<i64>, b: Vec<i64>) -> i64 {Parameters:
a:Vec<i64>b:Vec<i64>
Returns: i64
Defined at line 95
par_fill
Parallel fill: fill a Vec with a constant value. Currently sequential — each element is independent (embarrassingly parallel) but parallel write to a shared result Vec requires finer-grained synchronization.
pub fn par_fill(n: i64, value: i64) -> Vec<i64> {Parameters:
n:i64value:i64
Returns: Vec<i64>
Defined at line 119
par_range
Parallel range: generate a sequence [start, start+1, …, end-1]. Currently sequential — same limitation as par_fill.
pub fn par_range(start: i64, end: i64) -> Vec<i64> {Parameters:
start:i64end:i64
Returns: Vec<i64>
Defined at line 131
is_parallelizable
Check if a loop is parallelizable by analyzing its effects. Returns true if the loop body has no IO, no State, no Panic. A loop is parallelizable if it has no IO, no State, no Panic.
pub fn is_parallelizable(effect_mask: i64) -> bool {Parameters:
effect_mask:i64
Returns: bool
Defined at line 144
parallel_hint
Mark a loop as parallel for the compiler. This is a hint — the compiler will verify safety before parallelizing. In the current implementation, it’s a no-op.
pub fn parallel_hint() -> void { // No-op — compiler directive for future auto-parallelizationReturns: void
Defined at line 159
Generated by scribe, the Fides documentation generator