taskflow.taskflow
importTaskflow CPU task graphs through the upstream tf C++ module
import tf;
mcpp add taskflow.taskflow@4.1.0
用法
来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。
import std;
import tf;
bool taskflow_utility_ok();
int main() {
tf::Executor executor(2);
tf::Taskflow flow;
int left = 0;
int right = 0;
int joined = 0;
auto a = flow.emplace([&] { left = 20; });
auto b = flow.emplace([&] { right = 22; });
auto c = flow.emplace([&] { joined = left + right; });
a.precede(c);
b.precede(c);
executor.run(flow).get();
if (joined != 42) return 1;
std::vector<int> values(1024, 1);
int sum = 0;
tf::Taskflow reduction;
// …
tests/examples/taskflow-module/tests/taskflow.cpp · 项目 tests/examples/taskflow-module
构建
- modules
tf- targets
taskflow (lib)- language
c++23- import std
- no
- include dirs
*
源文件 (4)
*/modules/tf.core.cppm*/modules/tf.algorithm.cppm*/modules/tf.utility.cppm*/modules/tf.cppm
版本
| 版本 | 平台 | 镜像 | sha256 |
|---|---|---|---|
4.1.0 最新 |
LinuxWindowsmacOS | 源站 | 2107f90e315e… |