| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 296de26 commit 907f3ac
56 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,25 +34,31 @@ void omp_scan(int n, const T* in, T* out, Op op, unsigned nthreads) { | |||
| 34 | 34 | operation = op(operation, in[i]); | |
| 35 | 35 | } | |
| 36 | 36 | } | |
| 37 | - /* For region ends */ | ||
| 38 | - last_value_chunk_array[idthread+1] = operation; // Assigning sums of all chunks in last_chunk_value array | ||
| 39 | 37 | ||
| 40 | - #pragma omp barrier // Syncing all the threads | ||
| 38 | + // Assigning sums of all chunks in last_chunk_value array | ||
| 39 | + last_value_chunk_array[idthread+1] = operation; | ||
| 41 | 40 | ||
| 42 | - int balance = last_value_chunk_array[1]; // Initialising with index 1 value as for thread 0, result has already been calculated | ||
| 41 | + // synchronize all threads | ||
| 42 | + #pragma omp barrier | ||
| 43 | + | ||
| 44 | + // Initialising with index 1 value as for thread 0 | ||
| 45 | + // result has already been calculated | ||
| 46 | + int balance = last_value_chunk_array[1]; | ||
| 43 | 47 | if(idthread == 1) | |
| 44 | 48 | { | |
| 45 | - balance = last_value_chunk_array[1]; // For thread ID 1 | ||
| 49 | + balance = last_value_chunk_array[1]; // For thread ID 1 | ||
| 46 | 50 | } | |
| 47 | 51 | ||
| 52 | + // Creating balance for every thread | ||
| 48 | 53 | for(int i=2; i<(idthread+1); i++) | |
| 49 | - balance = op(balance,last_value_chunk_array[i]); // Creating balance for every thread | ||
| 54 | + balance = op(balance,last_value_chunk_array[i]); | ||
| 50 | 55 | ||
| 51 | - #pragma omp for schedule(static, chunk) // To calculate the sum of all chunks | ||
| 56 | + // To calculate the sum of all chunks | ||
| 57 | + #pragma omp for schedule(static, chunk) | ||
| 52 | 58 | for(int i=0; i<n; i++) { | |
| 53 | 59 | if(idthread != 0) | |
| 54 | 60 | { | |
| 55 | - out[i] = op(out[i], balance); // For thread IDs other than 0 | ||
| 61 | + out[i] = op(out[i], balance); | ||
| 56 | 62 | } | |
| 57 | 63 | } | |
| 58 | 64 | } | |
@@ -62,7 +68,7 @@ void omp_scan(int n, const T* in, T* out, Op op, unsigned nthreads) { | |||
| 62 | 68 | ||
| 63 | 69 | // scan_omp | |
| 64 | 70 | void scan_omp(size_t nthreads) { | |
| 65 | - omp_scan(input.size(), input.data(), output.data(), std::plus<int>{}, nthreads); | ||
| 71 | + omp_scan(input.size(), input.data(), output.data(), std::multiplies<int>{}, nthreads); | ||
| 66 | 72 | } | |
| 67 | 73 | ||
| 68 | 74 | std::chrono::microseconds measure_time_omp(size_t num_threads) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ void scan_taskflow(size_t num_threads) { | |||
| 8 | 8 | tf::Taskflow taskflow; | |
| 9 | 9 | ||
| 10 | 10 | taskflow.inclusive_scan( | |
| 11 | - input.begin(), input.end(), output.begin(), std::plus<int>{} | ||
| 11 | + input.begin(), input.end(), output.begin(), std::multiplies<int>{} | ||
| 12 | 12 | ); | |
| 13 | 13 | ||
| 14 | 14 | executor.run(taskflow).get(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,7 +51,7 @@ void scan_tbb(size_t num_threads) { | |||
| 51 | 51 | tbb::global_control c( | |
| 52 | 52 | tbb::global_control::max_allowed_parallelism, num_threads | |
| 53 | 53 | ); | |
| 54 | - inclusive_scan(input, 0, output, std::plus<int>{}); | ||
| 54 | + inclusive_scan(input, 0, output, std::multiplies<int>{}); | ||
| 55 | 55 | } | |
| 56 | 56 | ||
| 57 | 57 | std::chrono::microseconds measure_time_tbb(size_t num_threads) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,7 +48,7 @@ | |||
| 48 | 48 | <h1> | |
| 49 | 49 | Taskflow Algorithms | |
| 50 | 50 | </h1> | |
| 51 | - <p>Taskflow defines a set of algorithm primitives to perform common parallel algorithms:</p><ul><li><a href="PartitioningAlgorithm.html" class="m-doc">Partitioning Algorithm</a></li><li><a href="ParallelIterations.html" class="m-doc">Parallel Iterations</a></li><li><a href="ParallelTransforms.html" class="m-doc">Parallel Transforms</a></li><li><a href="ParallelReduction.html" class="m-doc">Parallel Reduction</a></li><li><a href="ParallelSort.html" class="m-doc">Parallel Sort</a></li><li><a href="TaskParallelPipeline.html" class="m-doc">Task-parallel Pipeline</a></li><li><a href="TaskParallelScalablePipeline.html" class="m-doc">Task-parallel Scalable Pipeline</a></li><li><a href="TaskParallelPipelineWithTokenDependencies.html" class="m-doc">Task-parallel Pipeline with Token Dependencies</a></li><li><a href="DataParallelPipeline.html" class="m-doc">Data-parallel Pipeline</a></li></ul> | ||
| 51 | + <p>Taskflow defines a set of algorithm primitives to perform common parallel algorithms:</p><ul><li><a href="PartitioningAlgorithm.html" class="m-doc">Partitioning Algorithm</a></li><li><a href="ParallelIterations.html" class="m-doc">Parallel Iterations</a></li><li><a href="ParallelTransforms.html" class="m-doc">Parallel Transforms</a></li><li><a href="ParallelReduction.html" class="m-doc">Parallel Reduction</a></li><li><a href="ParallelSort.html" class="m-doc">Parallel Sort</a></li><li><a href="ParallelScan.html" class="m-doc">Parallel Scan</a></li><li><a href="TaskParallelPipeline.html" class="m-doc">Task-parallel Pipeline</a></li><li><a href="TaskParallelScalablePipeline.html" class="m-doc">Task-parallel Scalable Pipeline</a></li><li><a href="TaskParallelPipelineWithTokenDependencies.html" class="m-doc">Task-parallel Pipeline with Token Dependencies</a></li><li><a href="DataParallelPipeline.html" class="m-doc">Data-parallel Pipeline</a></li></ul> | ||
| 52 | 52 | </div> | |
| 53 | 53 | </div> | |
| 54 | 54 | </div> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -552,7 +552,7 @@ <h3>Contents</h3> | |||
| 552 | 552 | </g> | |
| 553 | 553 | </g> | |
| 554 | 554 | </svg> | |
| 555 | - </div></section><section id="SupportedCompilers"><h2><a href="#SupportedCompilers">Supported Compilers</a></h2><p>To use Taskflow, you only need a compiler that supports C++17:</p><ul><li>GNU C++ Compiler at least v8.4 with -std=c++17</li><li>Clang C++ Compiler at least v6.0 with -std=c++17</li><li>Microsoft Visual Studio at least v19.27 with /std:c++17</li><li>AppleClang Xode Version at least v12.0 with -std=c++17</li><li>Nvidia CUDA Toolkit and Compiler (nvcc) at least v11.1 with -std=c++17</li><li>Intel C++ Compiler at least v19.0.1 with -std=c++17</li><li>Intel DPC++ Clang Compiler at least v13.0.0 with -std=c++17 and SYCL20</li></ul><p>Taskflow works on Linux, Windows, and Mac OS X.</p></section><section id="QuickStartGetInvolved"><h2><a href="#QuickStartGetInvolved">Get Involved</a></h2><p>Visit our <a href="https://taskflow.github.io/">Project Website</a> and <a href="https://taskflow.github.io/showcase/index.html">showcase presentation</a> to learn more about Taskflow. To get involved:</p><ul><li>See release notes at <a href="Releases.html" class="m-doc">Release Notes</a></li><li>Read the step-by-step tutorial at <a href="Cookbook.html" class="m-doc">Cookbook</a></li><li>Submit an issue at <a href="https://github.com/taskflow/taskflow/issues">issue tracker</a></li><li>Learn more about our technical details at <a href="References.html" class="m-doc">References</a></li><li>Watch our <a href="https://www.youtube.com/watch?v=MX15huP5DsM">2020 CppCon Taskflow Talk</a> and <a href="https://www.youtube.com/watch?v=u8Mc_WgGwVY">2020 MUC++ Taskflow Talk</a></li></ul><p>We are committed to support trustworthy developments for both academic and industrial research projects in parallel and heterogeneous computing. If you are using Taskflow, please cite the following paper we publised at 2022 IEEE TPDS:</p><ul><li>Tsung-Wei Huang, Dian-Lun Lin, Chun-Xun Lin, and Yibo Lin, "<a href="https://tsung-wei-huang.github.io/papers/tpds21-taskflow.pdf">Taskflow: A Lightweight Parallel and Heterogeneous Task Graph Computing System</a>," <em>IEEE Transactions on Parallel and Distributed Systems (TPDS)</em>, vol. 33, no. 6, pp. 1303-1320, June 2022</li></ul><p>More importantly, we appreciate all Taskflow <a href="contributors.html" class="m-doc">Contributors</a> and the following organizations for sponsoring the Taskflow project!</p><table class="m-table"><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td><img class="m-image" src="utah-ece-logo.png" alt="Image" /></td><td><img class="m-image" src="nsf.png" alt="Image" /></td><td><img class="m-image" src="darpa.png" alt="Image" /></td><td><img class="m-image" src="NumFocus.png" alt="Image" /></td></tr><tr><td><img class="m-image" src="nvidia-logo.png" alt="Image" /></td><td></td><td></td><td></td></tr></tbody></table></section><section id="License"><h2><a href="#License">License</a></h2><p>Taskflow is open-source under permissive MIT license. You are completely free to use, modify, and redistribute any work on top of Taskflow. The source code is available in <a href="https://github.com/taskflow/">Project GitHub</a> and is actively maintained by <a href="https://tsung-wei-huang.github.io/">Dr. Tsung-Wei Huang</a> and his research group at the University of Utah.</p></section> | ||
| 555 | + </div></section><section id="SupportedCompilers"><h2><a href="#SupportedCompilers">Supported Compilers</a></h2><p>To use Taskflow, you only need a compiler that supports C++17:</p><ul><li>GNU C++ Compiler at least v8.4 with -std=c++17</li><li>Clang C++ Compiler at least v6.0 with -std=c++17</li><li>Microsoft Visual Studio at least v19.27 with /std:c++17</li><li>AppleClang Xcode Version at least v12.0 with -std=c++17</li><li>Nvidia CUDA Toolkit and Compiler (nvcc) at least v11.1 with -std=c++17</li><li>Intel C++ Compiler at least v19.0.1 with -std=c++17</li><li>Intel DPC++ Clang Compiler at least v13.0.0 with -std=c++17 and SYCL20</li></ul><p>Taskflow works on Linux, Windows, and Mac OS X.</p></section><section id="QuickStartGetInvolved"><h2><a href="#QuickStartGetInvolved">Get Involved</a></h2><p>Visit our <a href="https://taskflow.github.io/">Project Website</a> and <a href="https://taskflow.github.io/showcase/index.html">showcase presentation</a> to learn more about Taskflow. To get involved:</p><ul><li>See release notes at <a href="Releases.html" class="m-doc">Release Notes</a></li><li>Read the step-by-step tutorial at <a href="Cookbook.html" class="m-doc">Cookbook</a></li><li>Submit an issue at <a href="https://github.com/taskflow/taskflow/issues">issue tracker</a></li><li>Learn more about our technical details at <a href="References.html" class="m-doc">References</a></li><li>Watch our <a href="https://www.youtube.com/watch?v=MX15huP5DsM">2020 CppCon Taskflow Talk</a> and <a href="https://www.youtube.com/watch?v=u8Mc_WgGwVY">2020 MUC++ Taskflow Talk</a></li></ul><p>We are committed to support trustworthy developments for both academic and industrial research projects in parallel and heterogeneous computing. If you are using Taskflow, please cite the following paper we publised at 2022 IEEE TPDS:</p><ul><li>Tsung-Wei Huang, Dian-Lun Lin, Chun-Xun Lin, and Yibo Lin, "<a href="https://tsung-wei-huang.github.io/papers/tpds21-taskflow.pdf">Taskflow: A Lightweight Parallel and Heterogeneous Task Graph Computing System</a>," <em>IEEE Transactions on Parallel and Distributed Systems (TPDS)</em>, vol. 33, no. 6, pp. 1303-1320, June 2022</li></ul><p>More importantly, we appreciate all Taskflow <a href="contributors.html" class="m-doc">Contributors</a> and the following organizations for sponsoring the Taskflow project!</p><table class="m-table"><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td><img class="m-image" src="utah-ece-logo.png" alt="Image" /></td><td><img class="m-image" src="nsf.png" alt="Image" /></td><td><img class="m-image" src="darpa.png" alt="Image" /></td><td><img class="m-image" src="NumFocus.png" alt="Image" /></td></tr><tr><td><img class="m-image" src="nvidia-logo.png" alt="Image" /></td><td></td><td></td><td></td></tr></tbody></table></section><section id="License"><h2><a href="#License">License</a></h2><p>Taskflow is open-source under permissive MIT license. You are completely free to use, modify, and redistribute any work on top of Taskflow. The source code is available in <a href="https://github.com/taskflow/">Project GitHub</a> and is actively maintained by <a href="https://tsung-wei-huang.github.io/">Dr. Tsung-Wei Huang</a> and his research group at the University of Utah.</p></section> | ||
| 556 | 556 | </div> | |
| 557 | 557 | </div> | |
| 558 | 558 | </div> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,7 +60,7 @@ <h3>Contents</h3> | |||
| 60 | 60 | <li><a href="#BAIBuildDocumentation">Build Documentation</a></li> | |
| 61 | 61 | </ul> | |
| 62 | 62 | </nav> | |
| 63 | - <p>This page describes how to set up Taskflow in your project. We will also go through the building process of unit tests and examples.</p><section id="BAISupportedCompilers"><h2><a href="#BAISupportedCompilers">Supported Compilers</a></h2><p>To use Taskflow, you only need a compiler that supports C++17:</p><ul><li>GNU C++ Compiler at least v8.4 with -std=c++17</li><li>Clang C++ Compiler at least v6.0 with -std=c++17</li><li>Microsoft Visual Studio at least v15.7 (MSVC++ 19.14)</li><li>AppleClang Xode Version at least v12.0 with -std=c++17</li><li>Nvidia CUDA Toolkit and Compiler (nvcc) at least v11.1 with -std=c++17</li><li>Intel C++ Compiler (nvcc) at least v19.0.1 with -std=c++17</li><li>Intel DPC++ Clang Compiler at least v13.0.0 with -std=c++17 and SYCL20</li></ul><p>Taskflow works on Linux, Windows, and Mac OS X.</p></section><section id="BAIIntegrateTaskflowToYourProject"><h2><a href="#BAIIntegrateTaskflowToYourProject">Integrate Taskflow to Your Project</a></h2><p>Taskflow is <em>header-only</em> and there is no need for installation. Simply download the source and copy the headers under the directory <code>taskflow/</code> to your project.</p><pre class="m-console"><span class="go">~$ git clone https://github.com/taskflow/taskflow.git</span> | ||
| 63 | + <p>This page describes how to set up Taskflow in your project. We will also go through the building process of unit tests and examples.</p><section id="BAISupportedCompilers"><h2><a href="#BAISupportedCompilers">Supported Compilers</a></h2><p>To use Taskflow, you only need a compiler that supports C++17:</p><ul><li>GNU C++ Compiler at least v8.4 with -std=c++17</li><li>Clang C++ Compiler at least v6.0 with -std=c++17</li><li>Microsoft Visual Studio at least v15.7 (MSVC++ 19.14)</li><li>AppleClang Xcode Version at least v12.0 with -std=c++17</li><li>Nvidia CUDA Toolkit and Compiler (nvcc) at least v11.1 with -std=c++17</li><li>Intel C++ Compiler (nvcc) at least v19.0.1 with -std=c++17</li><li>Intel DPC++ Clang Compiler at least v13.0.0 with -std=c++17 and SYCL20</li></ul><p>Taskflow works on Linux, Windows, and Mac OS X.</p></section><section id="BAIIntegrateTaskflowToYourProject"><h2><a href="#BAIIntegrateTaskflowToYourProject">Integrate Taskflow to Your Project</a></h2><p>Taskflow is <em>header-only</em> and there is no need for installation. Simply download the source and copy the headers under the directory <code>taskflow/</code> to your project.</p><pre class="m-console"><span class="go">~$ git clone https://github.com/taskflow/taskflow.git</span> | ||
| 64 | 64 | <span class="go">~$ cd taskflow/</span> | |
| 65 | 65 | <span class="go">~$ cp -r taskflow myproject/include/</span></pre><p>Taskflow is written in C++17 and is built on top of C++ standardized threading libraries to improve portability. To compile a Taskflow program, say <code>simple.cpp</code>, you need to tell the compiler where to find the Taskflow header files and link it through the system thread library (usually <a href="http://man7.org/linux/man-pages/man7/pthreads.7.html">POSIX threads</a> in Linux-like systems). Take gcc for an example:</p><pre class="m-console"><span class="go">~$ g++ simple.cpp -std=c++17 -I myproject/include/ -O2 -pthread -o simple</span></pre></section><section id="BAIBuildExamplesAndUnitTests"><h2><a href="#BAIBuildExamplesAndUnitTests">Build Examples and Unit Tests</a></h2><p>Taskflow uses CMake to build examples and unit tests. We recommend using out-of-source build.</p><pre class="m-console"><span class="go">~$ cd path/to/taskflow</span> | |
| 66 | 66 | <span class="go">~$ mkdir build</span> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -104,6 +104,7 @@ <h1>Pages</h1> | |||
| 104 | 104 | <li><a href="ParallelTransforms.html" class="m-doc">Parallel Transforms</a> <span class="m-doc"></span></li> | |
| 105 | 105 | <li><a href="ParallelReduction.html" class="m-doc">Parallel Reduction</a> <span class="m-doc"></span></li> | |
| 106 | 106 | <li><a href="ParallelSort.html" class="m-doc">Parallel Sort</a> <span class="m-doc"></span></li> | |
| 107 | + <li><a href="ParallelScan.html" class="m-doc">Parallel Scan</a> <span class="m-doc"></span></li> | ||
| 107 | 108 | <li><a href="TaskParallelPipeline.html" class="m-doc">Task-parallel Pipeline</a> <span class="m-doc"></span></li> | |
| 108 | 109 | <li><a href="TaskParallelScalablePipeline.html" class="m-doc">Task-parallel Scalable Pipeline</a> <span class="m-doc"></span></li> | |
| 109 | 110 | <li><a href="TaskParallelPipelineWithTokenDependencies.html" class="m-doc">Task-parallel Pipeline with Token Dependencies</a> <span class="m-doc"></span></li> | |
| Back | FazBrowse Home | New Git URL |
0 commit comments