An easy-to-use and fast header-only library written in C++17 for task-based parallel programming.
The following example contains most of the syntax you need to use Cpp-Taskflow.
#include <taskflow.hpp>
// A simple example to capture the following task dependencies.
//
// TaskA---->TaskB---->TaskD
// TaskA---->TaskC---->TaskD
//
int main(){
tf::Taskflow<> tf(std::thread::hardware_concurrency());
auto [A, B, C, D] = tf.silent_emplace(
[] () { std::cout << "TaskA\n"; },
[] () { std::cout << "TaskB\n"; },
[] () { std::cout << "TaskC\n"; },
[] () { std::cout << "TaskD\n"; }
);
A.precede(B);
A.precede(C);
B.precede(D);
C.precede(D);
tf.wait_for_all();
return 0;
}
To use Cpp-Taskflow, you only need a C++17 compiler:
- GNU C++ Compiler G++ v7.2 with -std=c++1z
- Report bugs/issues by submitting a GitHub issue.
- Submit contributions using pull requests.
- Tsung-Wei Huang
- Chun-Xun Lin
- You!
Copyright © 2018, Tsung-Wei Huang and Chun-Xun Lin. Released under the MIT license.