Closed GoogleCodeExporter closed 9 years ago
Thanks! I had never tested that code since I did not have PPL available. Did
you have to do that for it to work with "parallel_for_each"? or was it
necessary even with std::for_each?
Original comment by cast...@gmail.com
on 6 Apr 2011 at 6:41
It was necessary with std::for_each; I have not tested the parallel version
(i.e. the parallel_for_each line is still commented).
Original comment by arseny.k...@gmail.com
on 6 Apr 2011 at 2:49
Oh well, your changes seem to compile as well on VS2009, so I'll leave this as
is and test it more throughly when I upgrade. Thanks for the bug report!
Original comment by cast...@gmail.com
on 6 Apr 2011 at 6:32
Sorry, I should've checked it more extensively; the trunk now compiles fine in
Release, however in Debug there is some additional checking code in STL that
still results in compilation failure; one additional thing in order for
everything to work is to inherit CountingIterator from std::iterator:
class CountingIterator: public std::iterator<std::bidirectional_iterator_tag,
int>
After this both Debug & Release compile fine with the most recent trunk code.
Original comment by arseny.k...@gmail.com
on 23 Apr 2011 at 12:22
Also, uh, I would do it this way:
// Task dispatcher using Microsoft's concurrency runtime.
struct MicrosoftTaskDispatcher : public TaskDispatcher
{
virtual void dispatch(Task * task, void * context, int count)
{
TaskFunctor func(task, context);
Concurrency::parallel_for(0, count, func);
// for (int i = 0; i < count; ++i) func(i);
}
};
No need for CountingIterator at all; the parallel_for version works (as long as
I uncomment ppl.h include) and has the same performance as that of OpenMP one
(OpenMP version is selected by default).
Original comment by arseny.k...@gmail.com
on 23 Apr 2011 at 12:35
Cool, thanks for testing that!
Original comment by cast...@gmail.com
on 30 Apr 2011 at 11:12
Original issue reported on code.google.com by
arseny.k...@gmail.com
on 6 Apr 2011 at 3:23