Header-only C++ library for task-parallel programs on CPUs and GPUs
open sourceMITfree
Taskflow is a header-only C++20 library for writing task-parallel programs as graphs of tasks with dependencies. Tasks can spawn subflows, branch and loop with control-flow tasks, compose other task graphs and launch asynchronous tasks with dynamic dependencies, and an executor runs a graph once, several times or until a condition holds. It includes parallel algorithms (for_each, reduce, sort, pipelines), GPU tasks through NVIDIA CUDA Graph, a built-in profiler (TFProf) and DOT export for GraphViz. It runs on Linux, Windows and macOS with GCC, Clang, MSVC, Apple Clang, nvcc and Intel's compilers. Its author is Tsung-Wei Huang at the University of Wisconsin at Madison.
Problems it solves
- run dependent C++ tasks in parallel across all CPU cores
- parallelise loops, reductions and sorts in C++ without writing thread code
- mix CPU and GPU work in one C++ task graph
Features
- Header-only: include the headers and compile
- Task graphs with dependencies, subflows and composition
- Control-flow tasks for branches and loops
- Asynchronous tasks with dynamic dependencies
- Parallel for_each, reduce, sort and pipelines
- GPU tasks through NVIDIA CUDA Graph
- TFProf profiler and DOT export for GraphViz
Alternatives
The same job
These do what Taskflow does.
- RcppParallel Parallel programming tools for Rcpp code in R packages
