Folds.jl

A unified interface for sequential, threaded, and distributed fold
Author JuliaFolds
Popularity
23 Stars
Updated Last
1 Year Ago
Started In
June 2020

Folds: sequential, threaded, and distributed fold interface for Julia

Stable Dev GitHub Actions

Folds.jl provides a unified interface for sequential, threaded, and distributed folds.

julia> using Folds

julia> Folds.sum(1:10)
55

julia> Folds.sum(1:10, ThreadedEx())  # equivalent to above
55

julia> Folds.sum(1:10, DistributedEx())
55

Most of the functions can be used with iterator comprehensions:

julia> Folds.sum(y for x in 1:10 if isodd(x) for y in 1:x^2)
4917

and Transducers.jl:

julia> using Transducers

julia> 1:10 |> Filter(isodd) |> MapCat(x -> 1:x^2) |> Folds.sum
4917

Folds.jl decouples the implementation and the execution mechanism ("executor"). Additional executors can be installed from FoldsThreads.jl, FoldsCUDA.jl (rather WIP), and FoldsDagger.jl (very WIP).

Used By Packages

No packages found.