mcpp index

taskflow.taskflow

import

Taskflow 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…