Reducer interface
Michael Bien
mbien at fh-landshut.de
Sat Sep 17 17:36:00 PDT 2011
in case anybody is interested.. data-parallel implementation which does
most work in device cache using OpenCL (JOCL).
https://github.com/mbien/jocl/blob/edge/src/com/jogamp/opencl/util/pp/reduce.cl
https://github.com/mbien/jocl/blob/edge/src/com/jogamp/opencl/util/pp/Reduction.java
written for GPUs but works ok on CPUs.
regards,
michael
--
- - - -
http://michael-bien.com
On 09/18/2011 01:43 AM, Neal Gafter wrote:
> The operation this library calls "reduce" is more properly named "left fold"
> and, unless you can exploit algebraic properties of the function, is
> inherently sequential.
>
> When the element and output types are the same, and the function is known to
> be associative, you can use "parallel prefix" to compute the result in O(log
> n) time using O(n/log n) processors.
>
> On Sat, Sep 17, 2011 at 2:54 PM, Kasper Nielsen<kasperni at gmail.com> wrote:
>
>> Hi,
>>
>> Can somebody explain to me how the Reducer interface works in a parallel
>> setting?
>> I'm using something like E reduce(E a, E b) myself.
>> And I fail to understand how you can use two different parameter types
>> unless you force all usage to be serial (non-parallel) application of
>> elements.
>>
>> cheers
>> Kasper
>>
>>
>
More information about the lambda-dev
mailing list