[PATCH] [lld][Core] Implement parallel_for_each
Shankar Kalpathi Easwaran
shankarke at gmail.com
Mon Mar 16 12:47:10 PDT 2015
================
Comment at: include/lld/Core/Parallel.h:300
@@ +299,3 @@
+ const ptrdiff_t minParallelSizeForEach = 1024;
+ int64_t length = distance(begin, end);
+ int64_t taskSize = (length < minParallelSizeForEach)
----------------
ruiu wrote:
> Does this compile without std::?
compiles/runs fine for me.
================
Comment at: include/lld/Core/Parallel.h:303
@@ +302,3 @@
+ ? length
+ : length / minParallelSizeForEach;
+ while (taskSize <= distance(begin, end)) {
----------------
ruiu wrote:
> This expression doesn't make sense again. You divide length of the array with minSize, which is equal to how many minSize chunks in the array. It's not a task size.
>
> Let's make this simple as a starter. Just set 1024 to taskSize unconditionally. That's probably large enough. You may still have to run a test with that number, though.
will change. we cannot set taskSize to 1024 unconditionally if the length < 1024.
http://reviews.llvm.org/D8348
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list