Skip to main content

join2

Function join2 

Source
pub fn join2<A, B, RA, RB>(a: A, b: B) -> (RA, RB)
where A: FnOnce() -> RA + Send, B: FnOnce() -> RB + Send, RA: Send, RB: Send,
Expand description

Two independent pieces of work.

The rayon arm forks; the spin arm runs them one after the other, because each half already spreads across the whole pool internally and nesting a region inside a region is the one thing CpuPool::run cannot parallelize. That is llama.cpp’s shape too: its threadpool runs one graph node at a time, full width.