[Bug libstdc++/61075] parallel std::accumulate reduct type cannot be different than the iterated type

denes.matetelki at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue May 13 09:07:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61075

--- Comment #4 from Denes Matetelki <denes.matetelki at gmail dot com> ---
Thank you for the reply, Jonathan.

I understand your reasoning and not sure if my desires has much impact in the
future of GCC.

I'm suprised that the same source code cannot be compiled with parallel mode.
It would be ugly to branch with #ifdef _GLIBCXX_PARALLEL. 
Also, I feel it should be allowed for the user to create a custom labda to add
up custom types, just like in the single threaded mode.
The std::experimental::reduce is experimental, how shall I solve the problem
now? The world accumulate shows the intention, shall I use my own
implementation of reduce till that time: a parallel for_each then a single
threaded for to sum up?



More information about the Gcc-bugs mailing list