|
Taskflow
2.6.0
|
This page describes how to set up Taskflow in your project. We will also go through the building process of unit tests and examples.
Taskflow is header-only and there is no need for installation. Simply download the source and copy the headers under the directory taskflow/ to your project.
Taskflow is written in C++14 and is built on top of C++ standardized threading libraries to improve portability. To compile a Taskflow program, say simple.cpp, you need to tell the compiler where to find the Taskflow header files and link it through the system thread library (usually POSIX threads in Linux-like systems). Take gcc for an example:
To use Taskflow, you only need a compiler that supports C++14:
Taskflow works on Linux, Windows, and Mac OS X.
Taskflow uses CMake to build examples and unit tests. We recommend using out-of-source build.
When the building completes, you can find the executables for examples and tests under the two folders, examples/ and unittests/. By default, our CMake script automatically detects the existence of a CUDA compiler and compiles all GPU tests and examples if one is available.
You can list a set of available options in the cmake.
Currently, our CMake script supports the following options:
| CMake Option | Default | Usage |
|---|---|---|
| TF_BUILD_BENCHMARKS | OFF | enable/disable building benchmarks |
| TF_BUILD_CUDA | ON | enable/disable building CUDA code |
| TF_BUILD_EXAMPLES | ON | enable/disable building examples |
| TF_BUILD_TESTS | ON | enable/disable building unit tests |
To enable or disable a specific option, use -D in the CMake build. For example:
We have developed a set of benchmarks comparing Taskflow with OpenMP and Intel Threading Building Blocks (TBB) libraries. To build these benchmarks, you need to configure the option TF_BUILD_BENCHMARKS to ON.
You can find the binary of each benchmark under the folder benchmarks/.