Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Support][Parallel] Add sequential mode to TaskGroup::spawn().
This patch allows to specify that some part of tasks should be done in sequential order. It makes it possible to not use condition operator for separating sequential tasks: TaskGroup tg; for () { if(condition) ==> tg.spawn([](){fn();}, condition) fn(); else tg.spawn([](){fn();}); } It also prevents execution on main thread. Which allows adding checks for getThreadIndex() function discussed in D142318. The patch also replaces std::stack with std::deque in the ThreadPoolExecutor to have natural execution order in case (parallel::strategy.ThreadsRequested == 1). Differential Revision: https://reviews.llvm.org/D148728
- Loading branch information
Showing
5 changed files
with
57 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters