Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Donate
Please sign in before you donate.
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
1 Star 0 Fork 37

uxsys/cpp-taskflow

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
master
Branches (3)
Tags (15)
master
dev
cpp14
v3.4.0
v3.3.0
v3.2.0
v3.1.0
v3.0.0
v2.7.0
v2.6.0
v2.5.0
2.5.0
v2.4.0
v2.3.1
v2.3.0
v2.2.0
v2.1.0
v2.0.0
master
Branches (3)
Tags (15)
master
dev
cpp14
v3.4.0
v3.3.0
v3.2.0
v3.1.0
v3.0.0
v2.7.0
v2.6.0
v2.5.0
2.5.0
v2.4.0
v2.3.1
v2.3.0
v2.2.0
v2.1.0
v2.0.0
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
master
Branches (3)
Tags (15)
master
dev
cpp14
v3.4.0
v3.3.0
v3.2.0
v3.1.0
v3.0.0
v2.7.0
v2.6.0
v2.5.0
2.5.0
v2.4.0
v2.3.1
v2.3.0
v2.2.0
v2.1.0
v2.0.0
cpp-taskflow
/
docs
/
FAQ.html
cpp-taskflow
/
docs
/
FAQ.html
FAQ.html 23.83 KB
Copy Edit Raw Blame History
twhuang authored 2022年08月16日 02:24 +08:00 . revised doc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Frequently Asked Questions | Taskflow QuickStart</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
<link rel="stylesheet" href="m-dark+documentation.compiled.css" />
<link rel="icon" href="favicon.ico" type="image/vnd.microsoft.icon" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#22272e" />
</head>
<body>
<header><nav id="navigation">
<div class="m-container">
<div class="m-row">
<span id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">
<a href="https://taskflow.github.io"><img src="taskflow_logo.png" alt="" />Taskflow</a> <span class="m-breadcrumb">|</span> <a href="index.html" class="m-thin">QuickStart</a>
</span>
<div class="m-col-t-4 m-hide-m m-text-right m-nopadr">
<a href="#search" class="m-doc-search-icon" title="Search" onclick="return showSearch()"><svg style="height: 0.9rem;" viewBox="0 0 16 16">
<path id="m-doc-search-icon-path" d="m6 0c-3.31 0-6 2.69-6 6 0 3.31 2.69 6 6 6 1.49 0 2.85-0.541 3.89-1.44-0.0164 0.338 0.147 0.759 0.5 1.15l3.22 3.79c0.552 0.614 1.45 0.665 2 0.115 0.55-0.55 0.499-1.45-0.115-2l-3.79-3.22c-0.392-0.353-0.812-0.515-1.15-0.5 0.895-1.05 1.44-2.41 1.44-3.89 0-3.31-2.69-6-6-6zm0 1.56a4.44 4.44 0 0 1 4.44 4.44 4.44 4.44 0 0 1-4.44 4.44 4.44 4.44 0 0 1-4.44-4.44 4.44 4.44 0 0 1 4.44-4.44z"/>
</svg></a>
<a id="m-navbar-show" href="#navigation" title="Show navigation"></a>
<a id="m-navbar-hide" href="#" title="Hide navigation"></a>
</div>
<div id="m-navbar-collapse" class="m-col-t-12 m-show-m m-col-m-none m-right-m">
<div class="m-row">
<ol class="m-col-t-6 m-col-m-none">
<li><a href="pages.html">Handbook</a></li>
<li><a href="namespaces.html">Namespaces</a></li>
</ol>
<ol class="m-col-t-6 m-col-m-none" start="3">
<li><a href="annotated.html">Classes</a></li>
<li><a href="files.html">Files</a></li>
<li class="m-show-m"><a href="#search" class="m-doc-search-icon" title="Search" onclick="return showSearch()"><svg style="height: 0.9rem;" viewBox="0 0 16 16">
<use href="#m-doc-search-icon-path" />
</svg></a></li>
</ol>
</div>
</div>
</div>
</div>
</nav></header>
<main><article>
<div class="m-container m-container-inflatable">
<div class="m-row">
<div class="m-col-l-10 m-push-l-1">
<h1>
Frequently Asked Questions
</h1>
<nav class="m-block m-default">
<h3>Contents</h3>
<ul>
<li>
<a href="#GeneralQuestions">General Questions</a>
<ul>
<li><a href="#GeneralQuestion1">Q1: What&#x27;s the goal of Taskflow?</a></li>
<li><a href="#GeneralQuestion2">Q2: How do I use Taskflow in my projects?</a></li>
<li><a href="#GeneralQuestion3">Q3: What is the difference between static tasking and dynamic tasking?</a></li>
<li><a href="#GeneralQuestion4">Q4: How many tasks can Taskflow handle?</a></li>
<li><a href="#GeneralQuestion5">Q5: What is the weird hex value, like 0x7fc39d402ab0, in the dumped graph?</a></li>
<li><a href="#GeneralQuestion6">Q6: Does Taskflow have backward compatibility with C++03/98/11/14?</a></li>
<li><a href="#GeneralQuestion7">Q7: How does Taskflow schedule tasks?</a></li>
<li><a href="#GeneralQuestion8">Q8: What is the overhead of taskflow?</a></li>
<li><a href="#GeneralQuestion9">Q9: How does it compare to existing task programming systems?</a></li>
<li><a href="#GeneralQuestion10">Q10: Do you try to simplify the GPU kernel programming?</a></li>
<li><a href="#GeneralQuestion11">Q11: Do you have any real use cases?</a></li>
<li><a href="#GeneralQuestion12">Q12: Who is the Principal Investigator of Taskflow I can talk to?</a></li>
<li><a href="#GeneralQuestion13">Q13: Who are developing and maintaining Taskflow?</a></li>
<li><a href="#GeneralQuestion14">Q14: Is Taskflow just an another API or model?</a></li>
<li><a href="#GeneralQuestion15">Q15: How can I contribute?</a></li>
<li><a href="#GeneralQuestion16">Q16: Does Taskflow support pipeline parallelism?</a></li>
</ul>
</li>
<li>
<a href="#ProgrammingQuestions">Programming Questions</a>
<ul>
<li><a href="#ProgrammingQuestions1">Q1: What is the difference between Taskflow threads and workers?</a></li>
<li><a href="#ProgrammingQuestions2">Q2: What is the Lifetime of a Task and a Graph?</a></li>
<li><a href="#ProgrammingQuestions3">Q3: Is taskflow thread-safe?</a></li>
<li><a href="#ProgrammingQuestions4">Q4: Is executor thread-safe?</a></li>
<li><a href="#ProgrammingQuestions5">Q5: My program hangs and never returns after dispatching a taskflow graph. What&#x27;s wrong?</a></li>
<li><a href="#ProgrammingQuestions6">Q6: In the following example where B spawns a joined subflow of three tasks B1, B2, and B3, do they run concurrently with task A?</a></li>
<li><a href="#ProgrammingQuestions7">Q7: What is the purpose of a condition task?</a></li>
<li><a href="#ProgrammingQuestions8">Q8: Is the program master thread involved in running tasks?</a></li>
<li><a href="#ProgrammingQuestions9">Q9: Are there any limits on the branches of conditional tasking?</a></li>
<li><a href="#ProgrammingQuestions10">Q10: Why does Taskflow program GPU in a task graph?</a></li>
<li><a href="#ProgrammingQuestions11">Q11: Can I limit the concurrency in certain sections of tasks?</a></li>
<li><a href="#ProgrammingQuestions12">Q12: How can I attach custom data to a task and access it?</a></li>
</ul>
</li>
</ul>
</nav>
<p>This page summarizes a list of frequently asked questions about Taskflow. If you cannot find a solution here, please post an issue at <a href="https://github.com/taskflow/taskflow/issues">here</a>.</p><section id="GeneralQuestions"><h2><a href="#GeneralQuestions">General Questions</a></h2><section id="GeneralQuestion1"><h3><a href="#GeneralQuestion1">Q1: What&#x27;s the goal of Taskflow?</a></h3><p>Taskflow aims to help C++ developers quickly implement efficient parallel decomposition strategies using task-based approaches.</p></section><section id="GeneralQuestion2"><h3><a href="#GeneralQuestion2">Q2: How do I use Taskflow in my projects?</a></h3><p>Taskflow is a header-only library with zero dependencies. The only thing you need is a C++17 compiler. To use Taskflow, simply drop the folder <code>taskflow/</code> to your project and include taskflow.hpp.</p></section><section id="GeneralQuestion3"><h3><a href="#GeneralQuestion3">Q3: What is the difference between static tasking and dynamic tasking?</a></h3><p>Static tasking refers to those tasks created before execution, while dynamic tasking refers to those tasks created during the execution of static tasks or dynamic tasks (nested). Dynamic tasks created by the same task node are grouped together to a subflow.</p></section><section id="GeneralQuestion4"><h3><a href="#GeneralQuestion4">Q4: How many tasks can Taskflow handle?</a></h3><p>Benchmarks showed Taskflow can efficiently handle millions or billions of tasks (both large and small tasks) on a machine with up to 64 CPUs.</p></section><section id="GeneralQuestion5"><h3><a href="#GeneralQuestion5">Q5: What is the weird hex value, like 0x7fc39d402ab0, in the dumped graph?</a></h3><p>The hex value represents the memory address of the task. Each task has a method <a href="classtf_1_1Task.html#a9057ecd0f3833b717480e914f8568f02" class="m-doc">tf::<wbr />Task::<wbr />name(const std::<wbr />string&amp;)</a> for user to assign a human readable string to ease the debugging process. If a task is not assigned a name or is an internal node, its address value in the memory is used instead.</p></section><section id="GeneralQuestion6"><h3><a href="#GeneralQuestion6">Q6: Does Taskflow have backward compatibility with C++03/98/11/14?</a></h3><p>Unfortunately, Taskflow is heavily relying on modern C++17&#x27;s features/idoms/STL and it is very difficult to provide a version that compiles under older C++ versions.</p></section><section id="GeneralQuestion7"><h3><a href="#GeneralQuestion7">Q7: How does Taskflow schedule tasks?</a></h3><p>Taskflow implemented a very efficient <a href="https://en.wikipedia.org/wiki/Work_stealing">work-stealing scheduler</a> to execute task dependency graphs. The source code is available at <code><a href="executor_8hpp.html" class="m-doc">taskflow/<wbr />core/<wbr />executor.hpp</a></code>.</p></section><section id="GeneralQuestion8"><h3><a href="#GeneralQuestion8">Q8: What is the overhead of taskflow?</a></h3><p>Creating a taskflow has certain overhead. For example, creating a task and a dependency takes about 61 and 14 nanoseconds in our system (Intel 4-core CPU at 2.00GHz). The time is amortized over 1M operations, since we have implemented an object pool to recycle tasks for minimal overhead.</p></section><section id="GeneralQuestion9"><h3><a href="#GeneralQuestion9">Q9: How does it compare to existing task programming systems?</a></h3><p>There is a large amount of work on programming systems (e.g., StarPU, Intel TBB, OpenMP, PaRSEC, Kokkos, HPX) in the interest of simplifying the programming complexity of parallel and heterogeneous computing. Each of these systems has its own pros and cons and deserves a reason to exist. However, they do have some problems, particularly from the standpoint of ease of use, static control flow, and scheduling efficiency. Taskflow addresses these limitations through a simple, expressive, and transparent graph programming model.</p></section><section id="GeneralQuestion10"><h3><a href="#GeneralQuestion10">Q10: Do you try to simplify the GPU kernel programming?</a></h3><p>No, we do not develop new programming models to simplify the kernel programming. The rationale is simple: Writing efficient kernels requires domain-specific knowledge and developers often require direct access to the native GPU programming interface. High-level kernel programming models or abstractions all come with restricted applicability. Despite non-trivial kernel programming, we believe what makes heterogeneous computing difficult are surrounding tasks. A mistake made by task scheduling can outweigh all speed-up benefits from a highly optimized kernel. Therefore, Taskflow focuses on heterogeneous tasking that affects the overall system performance to a large extent.</p></section><section id="GeneralQuestion11"><h3><a href="#GeneralQuestion11">Q11: Do you have any real use cases?</a></h3><p>We have applied Taskflow to solve many realistic workloads and demonstrated promising performance scalability and programming productivity. Please refer to <a href="usecases.html" class="m-doc">Real Use Cases</a> and <a href="References.html" class="m-doc">References</a>.</p></section><section id="GeneralQuestion12"><h3><a href="#GeneralQuestion12">Q12: Who is the Principal Investigator of Taskflow I can talk to?</a></h3><p>Please visit this <a href="https://taskflow.github.io/#tag_contact">page</a> or email the investigator <a href="https://tsung-wei-huang.github.io/">Dr. Tsung-Wei Huang</a>.</p></section><section id="GeneralQuestion13"><h3><a href="#GeneralQuestion13">Q13: Who are developing and maintaining Taskflow?</a></h3><p>Taskflow is in active development with core functionalities contributed by an academic group at the University of Utah, led by <a href="https://tsung-wei-huang.github.io/">Dr. Tsung-Wei Huang</a>. While coming out of an academic lab, Taskflow aims to be industrial-strength and is committed to long-term support.</p></section><section id="GeneralQuestion14"><h3><a href="#GeneralQuestion14">Q14: Is Taskflow just an another API or model?</a></h3><p>OK, let me ask this first: <em>Is your new car just another vehicle? Or, is your new home just another place to live?</em></p><p>The answer to this question is the question itself. As technology advances, we can always find new ways to solve computational problems and achieve new performance milestones that were previously out-of-reach.</p></section><section id="GeneralQuestion15"><h3><a href="#GeneralQuestion15">Q15: How can I contribute?</a></h3><p>New contributors are always welcome! Please visit <a href="Contributing.html" class="m-doc">Contributing</a>.</p></section><section id="GeneralQuestion16"><h3><a href="#GeneralQuestion16">Q16: Does Taskflow support pipeline parallelism?</a></h3><p>Yes, Taskflow has a specialized programming model to create a pipeline scheduling framework. Please visit <a href="TaskParallelPipeline.html" class="m-doc">Task-parallel Pipeline</a> and <a href="DataParallelPipeline.html" class="m-doc">Data-parallel Pipeline</a>.</p><hr/></section></section><section id="ProgrammingQuestions"><h2><a href="#ProgrammingQuestions">Programming Questions</a></h2><section id="ProgrammingQuestions1"><h3><a href="#ProgrammingQuestions1">Q1: What is the difference between Taskflow threads and workers?</a></h3><p>The master thread owns the thread pool and can spawn workers to run tasks or shutdown the pool. Giving taskflow <code>N</code> threads means using <code>N</code> threads to do the works, and there is a total of <code>N+1</code> threads (including the master thread) in the program. Please refer to <a href="ExecuteTaskflow.html#CreateAnExecutor" class="m-doc">Create an Executor</a> for more details.</p></section><section id="ProgrammingQuestions2"><h3><a href="#ProgrammingQuestions2">Q2: What is the Lifetime of a Task and a Graph?</a></h3><p>The lifetime of a task sticks with its parent graph. A task is not destroyed until its parent graph is destroyed. Please refer to <a href="StaticTasking.html#UnderstandTheLifetimeOfATask" class="m-doc">Understand the Lifetime of a Task</a> for more details.</p></section><section id="ProgrammingQuestions3"><h3><a href="#ProgrammingQuestions3">Q3: Is taskflow thread-safe?</a></h3><p>No, the taskflow object is not thread-safe. Multiple threads cannot create tasks from the same taskflow at the same time.</p></section><section id="ProgrammingQuestions4"><h3><a href="#ProgrammingQuestions4">Q4: Is executor thread-safe?</a></h3><p>Yes, the executor object is thread-safe. You can have multiple threads submit different taskflows to the same executor.</p></section><section id="ProgrammingQuestions5"><h3><a href="#ProgrammingQuestions5">Q5: My program hangs and never returns after dispatching a taskflow graph. What&#x27;s wrong?</a></h3><p>When the program hangs forever it is very likely your taskflow graph has a cycle or not properly conditioned (see <a href="ConditionalTasking.html" class="m-doc">Conditional Tasking</a>). Try the <a href="classtf_1_1Taskflow.html#ac433018262e44b12c4cc9f0c4748d758" class="m-doc">tf::<wbr />Taskflow::<wbr />dump</a> method to debug the graph before dispatching your taskflow graph.</p></section><section id="ProgrammingQuestions6"><h3><a href="#ProgrammingQuestions6">Q6: In the following example where B spawns a joined subflow of three tasks B1, B2, and B3, do they run concurrently with task A?</a></h3><div class="m-graph"><svg style="width: 23.250rem; height: 15.188rem;" viewBox="0.00 0.00 372.00 243.00">
<g transform="scale(1 1) rotate(0) translate(4 239)">
<title>Taskflow</title>
<g class="m-cluster">
<title>cluster_p0x7ffee9781810</title>
<polygon points="8,-8 8,-227 356,-227 356,-8 8,-8"/>
<text text-anchor="middle" x="182" y="-210.2">Taskflow</text>
</g>
<g class="m-cluster">
<title>cluster_p0x7f9866c01b70</title>
<polygon points="16,-60 16,-193 266,-193 266,-60 16,-60"/>
<text text-anchor="middle" x="141" y="-176.2">Subflow: B</text>
</g>
<g class="m-node m-flat">
<title>p0x7f9866c01820</title>
<ellipse cx="141" cy="-34" rx="27" ry="18.2703"/>
<text text-anchor="middle" x="141" y="-30.2">A</text>
</g>
<g class="m-node m-flat">
<title>p0x7f9866c01b70</title>
<ellipse cx="231" cy="-89" rx="27" ry="18.2703"/>
<text text-anchor="middle" x="231" y="-85.2">B</text>
</g>
<g class="m-edge">
<title>p0x7f9866c01820&#45;&gt;p0x7f9866c01b70</title>
<path d="M161.4224,-46.4804C173.3897,-53.7937 188.7024,-63.1515 201.9143,-71.2254"/>
<polygon points="200.3005,-74.341 210.6584,-76.569 203.9507,-68.368 200.3005,-74.341"/>
</g>
<g class="m-node m-flat">
<title>p0x7f9866c01930</title>
<ellipse cx="231" cy="-34" rx="27" ry="18.2703"/>
<text text-anchor="middle" x="231" y="-30.2">C</text>
</g>
<g class="m-edge">
<title>p0x7f9866c01820&#45;&gt;p0x7f9866c01930</title>
<path d="M168.003,-34C176.0277,-34 184.9665,-34 193.5309,-34"/>
<polygon points="193.7051,-37.5001 203.705,-34 193.705,-30.5001 193.7051,-37.5001"/>
</g>
<g class="m-node m-flat">
<title>p0x7f9866c01a40</title>
<ellipse cx="321" cy="-61" rx="27" ry="18.2703"/>
<text text-anchor="middle" x="321" y="-57.2">D</text>
</g>
<g class="m-edge">
<title>p0x7f9866c01b70&#45;&gt;p0x7f9866c01a40</title>
<path d="M255.5929,-81.3489C265.2164,-78.3549 276.4198,-74.8694 286.8067,-71.6379"/>
<polygon points="287.928,-74.9546 296.4368,-68.6419 285.8485,-68.2706 287.928,-74.9546"/>
</g>
<g class="m-edge">
<title>p0x7f9866c01930&#45;&gt;p0x7f9866c01a40</title>
<path d="M256.07,-41.521C265.4322,-44.3297 276.2367,-47.571 286.3123,-50.5937"/>
<polygon points="285.4804,-53.9982 296.0644,-53.5193 287.4919,-47.2934 285.4804,-53.9982"/>
</g>
<g class="m-node m-flat">
<title>p0x7f9866d01880</title>
<ellipse cx="51" cy="-141" rx="27" ry="18.2703"/>
<text text-anchor="middle" x="51" y="-137.2">B1</text>
</g>
<g class="m-node m-flat">
<title>p0x7f9866d01ac0</title>
<ellipse cx="141" cy="-89" rx="27" ry="18.2703"/>
<text text-anchor="middle" x="141" y="-85.2">B3</text>
</g>
<g class="m-edge">
<title>p0x7f9866d01880&#45;&gt;p0x7f9866d01ac0</title>
<path d="M71.874,-128.9395C83.574,-122.1795 98.3631,-113.6346 111.2568,-106.1849"/>
<polygon points="113.3315,-109.0285 120.2392,-100.9951 109.8295,-102.9674 113.3315,-109.0285"/>
</g>
<g class="m-edge">
<title>p0x7f9866d01ac0&#45;&gt;p0x7f9866c01b70</title>
<path d="M168.003,-89C176.0277,-89 184.9665,-89 193.5309,-89"/>
<polygon points="193.7051,-92.5001 203.705,-89 193.705,-85.5001 193.7051,-92.5001"/>
</g>
<g class="m-node m-flat">
<title>p0x7f9866d019a0</title>
<ellipse cx="51" cy="-86" rx="27" ry="18.2703"/>
<text text-anchor="middle" x="51" y="-82.2">B2</text>
</g>
<g class="m-edge">
<title>p0x7f9866d019a0&#45;&gt;p0x7f9866d01ac0</title>
<path d="M78.003,-86.9001C86.1013,-87.17 95.1306,-87.471 103.7665,-87.7589"/>
<polygon points="103.905,-91.2654 114.0161,-88.1005 104.1383,-84.2692 103.905,-91.2654"/>
</g>
</g>
</svg>
</div><p>No. The subflow is spawned during the execution of <code>B</code>, and at this point <code>A</code> must have finished because <code>A</code> precedes <code>B</code>. This gives rise to the fact <code>B1</code> and <code>B2</code> must run after <code>A</code>.</p></section><section id="ProgrammingQuestions7"><h3><a href="#ProgrammingQuestions7">Q7: What is the purpose of a condition task?</a></h3><p>A condition task lets you perform <em>in-task</em> decision making so you can integrate control flow into a task graph with end-to-end parallelism without synchronizing or partitioning your parallelism across conditionals.</p></section><section id="ProgrammingQuestions8"><h3><a href="#ProgrammingQuestions8">Q8: Is the program master thread involved in running tasks?</a></h3><p>No, the program master thread is not involved in running taskflows. The executor keeps a set of private worker threads spawned upon construction time to run tasks.</p></section><section id="ProgrammingQuestions9"><h3><a href="#ProgrammingQuestions9">Q9: Are there any limits on the branches of conditional tasking?</a></h3><p>No, as long as the return value points to a valid successors, your conditional tasking is valid.</p></section><section id="ProgrammingQuestions10"><h3><a href="#ProgrammingQuestions10">Q10: Why does Taskflow program GPU in a task graph?</a></h3><p>We ask users to describe a GPU workload in a task graph and execute it in a second moment. This organization minimizes kernels launch overhead and allows the GPU runtime (e.g., CUDA) to optimize the whole workflow.</p></section><section id="ProgrammingQuestions11"><h3><a href="#ProgrammingQuestions11">Q11: Can I limit the concurrency in certain sections of tasks?</a></h3><p>Yes, Taskflow provides a lightweight mechanism, <a href="classtf_1_1Semaphore.html" class="m-doc">tf::<wbr />Semaphore</a>, for you to limit the maximum concurrency (i.e., the number of workers) in a section of tasks. Please refer to <a href="LimitTheMaximumConcurrency.html" class="m-doc">Limit the Maximum Concurrency</a>.</p></section><section id="ProgrammingQuestions12"><h3><a href="#ProgrammingQuestions12">Q12: How can I attach custom data to a task and access it?</a></h3><p>Each node in a taskflow is associated with a C-styled data pointer (i.e., <code>void*</code>) you can use to point to user data and access it in the body of a task callable. Please refer to <a href="StaticTasking.html#AttachUserDataToATask" class="m-doc">Attach User Data to a Task</a>.</p></section></section>
</div>
</div>
</div>
</article></main>
<div class="m-doc-search" id="search">
<a href="#!" onclick="return hideSearch()"></a>
<div class="m-container">
<div class="m-row">
<div class="m-col-m-8 m-push-m-2">
<div class="m-doc-search-header m-text m-small">
<div><span class="m-label m-default">Tab</span> / <span class="m-label m-default">T</span> to search, <span class="m-label m-default">Esc</span> to close</div>
<div id="search-symbolcount">&hellip;</div>
</div>
<div class="m-doc-search-content">
<form>
<input type="search" name="q" id="search-input" placeholder="Loading &hellip;" disabled="disabled" autofocus="autofocus" autocomplete="off" spellcheck="false" />
</form>
<noscript class="m-text m-danger m-text-center">Unlike everything else in the docs, the search functionality <em>requires</em> JavaScript.</noscript>
<div id="search-help" class="m-text m-dim m-text-center">
<p class="m-noindent">Search for symbols, directories, files, pages or
modules. You can omit any prefix from the symbol or file path; adding a
<code>:</code> or <code>/</code> suffix lists all members of given symbol or
directory.</p>
<p class="m-noindent">Use <span class="m-label m-dim">&darr;</span>
/ <span class="m-label m-dim">&uarr;</span> to navigate through the list,
<span class="m-label m-dim">Enter</span> to go.
<span class="m-label m-dim">Tab</span> autocompletes common prefix, you can
copy a link to the result using <span class="m-label m-dim"></span>
<span class="m-label m-dim">L</span> while <span class="m-label m-dim"></span>
<span class="m-label m-dim">M</span> produces a Markdown link.</p>
</div>
<div id="search-notfound" class="m-text m-warning m-text-center">Sorry, nothing was found.</div>
<ul id="search-results"></ul>
</div>
</div>
</div>
</div>
</div>
<script src="search-v2.js"></script>
<script src="searchdata-v2.js" async="async"></script>
<footer><nav>
<div class="m-container">
<div class="m-row">
<div class="m-col-l-10 m-push-l-1">
<p>Taskflow handbook is part of the <a href="https://taskflow.github.io">Taskflow project</a>, copyright © <a href="https://tsung-wei-huang.github.io/">Dr. Tsung-Wei Huang</a>, 2018&ndash;2022.<br />Generated by <a href="https://doxygen.org/">Doxygen</a> 1.8.14 and <a href="https://mcss.mosra.cz/">m.css</a>.</p>
</div>
</div>
</div>
</nav></footer>
</body>
</html>
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

About

cpp-taskflow 是一个开源的 C++ 并行任务编程库,cpp-tastflow 非常快,只包含头文件,可以帮你快速编写包含复杂任务依赖的并行程序
Cancel

Releases

No release

Contributors

All

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/uxsys/cpp-taskflow.git
git@gitee.com:uxsys/cpp-taskflow.git
uxsys
cpp-taskflow
cpp-taskflow
master
Going to Help Center

Search

Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /