llvm.org GIT mirror llvm / 7c964ef
Fix build errors with Parallel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302749 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 3 years ago
2 changed file(s) with 7 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
3535 mutable std::condition_variable Cond;
3636
3737 public:
38 explicit Latch(uint32_t count = 0) : Count(Count) {}
38 explicit Latch(uint32_t Count = 0) : Count(Count) {}
3939 ~Latch() { sync(); }
4040
4141 void inc() {
116116
117117 template
118118 void parallel_quick_sort(RandomAccessIterator Start, RandomAccessIterator End,
119 const Comparator &Comp, TaskGroup &TG, size_t Depth) {
119 const Comparator &Comp, detail::TaskGroup &TG,
120 size_t Depth) {
120121 // Do a sequential sort for small inputs.
121122 if (std::distance(Start, End) < detail::MinParallelSize || Depth == 0) {
122123 std::sort(Start, End, Comp);
143144 template
144145 void parallel_sort(RandomAccessIterator Start, RandomAccessIterator End,
145146 const Comparator &Comp) {
146 TaskGroup TG;
147 detail::TaskGroup TG;
147148 parallel_quick_sort(Start, End, Comp, TG,
148149 llvm::Log2_64(std::distance(Start, End)) + 1);
149150 }
158159 if (TaskSize == 0)
159160 TaskSize = 1;
160161
161 TaskGroup TG;
162 detail::TaskGroup TG;
162163 while (TaskSize <= std::distance(Begin, End)) {
163164 TG.spawn([=, &Fn] { std::for_each(Begin, Begin + TaskSize, Fn); });
164165 Begin += TaskSize;
172173 if (TaskSize == 0)
173174 TaskSize = 1;
174175
175 TaskGroup TG;
176 detail::TaskGroup TG;
176177 IndexTy I = Begin;
177178 for (; I + TaskSize < End; I += TaskSize) {
178179 TG.spawn([=, &Fn] {
116116 std::stack> WorkStack;
117117 std::mutex Mutex;
118118 std::condition_variable Cond;
119 Latch Done;
119 detail::Latch Done;
120120 };
121121
122122 Executor *Executor::getDefaultExecutor() {