[Core] Add parallel_for_each.

llvm-svn: 182794
This commit is contained in:
Michael J. Spencer 2013-05-28 19:09:39 +00:00
parent 9ae1408556
commit 5b904eccad
1 changed files with 14 additions and 0 deletions

View File

@ -252,6 +252,20 @@ void parallel_sort(
template <class T> void parallel_sort(T *start, T *end) {
parallel_sort(start, end, std::less<T>());
}
#ifdef _MSC_VER
// Use ppl parallel_for_each on Windows.
template <class Iterator, class Func>
void parallel_for_each(Iterator begin, Iterator end, Func func) {
concurrency::parallel_for_each(begin, end, func);
}
#else
template <class Iterator, class Func>
void parallel_for_each(Iterator begin, Iterator end, Func func) {
// TODO: Make this parallel.
std::for_each(begin, end, func);
}
#endif
} // end namespace lld
#endif