Skip to content

Commit 41802c2

Browse files
updated examples
1 parent 3cb5cfb commit 41802c2

9 files changed

Lines changed: 26 additions & 25 deletions

File tree

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
[![Standard](image/cpp17.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization)
55
[![Download](image/download.svg)](https://github.com/cpp-taskflow/cpp-taskflow/archive/master.zip)
66
[![AskMe](image/askme.svg)][Github issues]
7-
[![Insights](image/maintained.svg)][Github insights]
87
[![License: MIT](./image/license_badge.svg)](./LICENSE)
8+
[![Donate](image/donate.svg)][PayMe]
99

1010
A fast C++ header-only library to help you quickly build parallel programs with complex task dependencies.
1111

@@ -32,7 +32,7 @@ and is by far faster, more expressive, and easier for drop-in integration than e
3232
The following example [simple.cpp](./example/simple.cpp) shows the basic API you need to use Cpp-Taskflow.
3333

3434
```cpp
35-
#include <taskflow.hpp> // the only include you need
35+
#include <taskflow/taskflow.hpp> // Cpp-Taskflow is header-only
3636

3737
int main(){
3838

@@ -751,6 +751,9 @@ that incorporate complex task dependencies.
751751

752752
Please [let me know][email me] if I forgot your project!
753753

754+
If you work for a company using Cpp-Taskflow or has the means to do so,
755+
please consider [financial support][PayMe].
756+
754757
# License
755758

756759
<img align="right" src="http://opensource.org/trademarks/opensource/OSI-Approved-License-100x137.png">
@@ -785,5 +788,6 @@ Cpp-Taskflow is licensed under the [MIT License](./LICENSE):
785788
[totalgee]: https://github.com/totalgee
786789
[damienhocking]: https://github.com/damienhocking
787790
[FAQ]: ./doc/faq.md
791+
[PayMe]: https://www.paypal.me/twhuang/10
788792
[email me]: mailto:[email protected]
789793

example/debug.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This example demonstrates how to use 'dump' method to inspect
22
// a taskflow graph.
33

4-
#include "taskflow.hpp"
4+
#include <taskflow/taskflow.hpp>
55

66
int main(){
77

example/emplace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// or 'silent_emplace'.
33

44
#include <cassert>
5-
#include "taskflow.hpp"
5+
#include <taskflow/taskflow.hpp>
66

77
int main(){
88

example/matrix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// and compares the runtime between baseline (sequential), OpenMP, C++ thread,
33
// and Taskflow implementations.
44

5-
#include "taskflow.hpp"
5+
#include <taskflow/taskflow.hpp>
66
#include <random>
77
#include <numeric>
88
#include <fstream>

example/parallel_for.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "taskflow.hpp"
1+
#include <taskflow/taskflow.hpp>
22
#include <cassert>
33
#include <numeric>
44

example/reduce.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This example demonstrates how to use 'reduce' method.
22

3-
#include "taskflow.hpp"
3+
#include <taskflow/taskflow.hpp>
44

55
#include <chrono>
66
#include <limits.h>

example/simple.cpp

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,24 @@
33
// TaskA---->TaskB---->TaskD
44
// TaskA---->TaskC---->TaskD
55

6-
#include <taskflow.hpp> // the only include you need
6+
#include <taskflow/taskflow.hpp> // the only include you need
77

88
int main(){
99

1010
tf::Taskflow tf(std::thread::hardware_concurrency());
1111

12-
auto [A, B, C, D] = tf.silent_emplace(
13-
[] () { std::cout << "TaskA\n"; }, // the taskflow graph
14-
[] () { std::cout << "TaskB\n"; }, //
15-
[] () { std::cout << "TaskC\n"; }, // +---+
16-
[] () { std::cout << "TaskD\n"; } // +---->| B |-----+
17-
); // | +---+ |
18-
// +---+ +-v-+
19-
A.precede(B); // B runs after A // | A | | D |
20-
A.precede(C); // C runs after A // +---+ +-^-+
21-
B.precede(D); // D runs after B // | +---+ |
22-
C.precede(D); // D runs after C // +---->| C |-----+
23-
// +---+
24-
25-
std::cout << tf.dump();
26-
12+
auto [A, B, C, D] = tf.silent_emplace( // the taskflow graph
13+
[] () { std::cout << "TaskA\n"; }, //
14+
[] () { std::cout << "TaskB\n"; }, // +---+
15+
[] () { std::cout << "TaskC\n"; }, // +---->| B |-----+
16+
[] () { std::cout << "TaskD\n"; } // | +---+ |
17+
); // +---+ +-v-+
18+
// | A | | D |
19+
A.precede(B); // B runs after A // +---+ +-^-+
20+
A.precede(C); // C runs after A // | +---+ |
21+
B.precede(D); // D runs after B // +---->| C |-----+
22+
C.precede(D); // D runs after C // +---+
23+
2724
tf.wait_for_all(); // block until finished
2825

2926
return 0;

example/subflow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// Usage: ./subflow detach|join
1414
//
1515

16-
#include <taskflow.hpp>
16+
#include <taskflow/taskflow.hpp>
1717

1818
const auto usage = "usage: ./subflow detach|join";
1919

unittest/taskflow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "doctest.h"
44

5-
#include <taskflow.hpp>
5+
#include <taskflow/taskflow.hpp>
66
#include <vector>
77
#include <utility>
88
#include <chrono>

0 commit comments

Comments
 (0)