Module type Parallel_arrays.Scan

type 'a t
val scan : Parallel_kernel.t @ local -> ('a t -> (init:'a -> (f: (Parallel_kernel.t @ local -> ('a @ shared -> ('a @ shared -> 'a) @ local) @ local) @ shareable -> 'a t * 'a) @ local) @ local) @ local

scan parallel t ~init ~f initialises an array containing the exclusive prefix sums of t with respect to f. The first element is init and the full reduction of t is returned separately. f must be associative and f init x must equal x.

val scan_inclusive : Parallel_kernel.t @ local -> ('a t -> (init:'a -> (f: (Parallel_kernel.t @ local -> ('a @ shared -> ('a @ shared -> 'a) @ local) @ local) @ shareable -> 'a t) @ local) @ local) @ local

scan_inclusive parallel t ~init ~f initialises an array containing the inclusive prefix sums of t with respect to f. The first element is the first element of t. f must be associative and f init x must equal x.