numba-dpex icon indicating copy to clipboard operation
numba-dpex copied to clipboard

`@reduce` decorator

Open PokhodenkoSA opened this issue 4 years ago • 1 comments

We currently do not have anything similar to @cuda.reduce and the output of this step should be a design to support a similar @reduce decorator for numba-dppy.

Features to implement:

  • [ ] @dppy.reduce
  • [ ] Support lambda
  • [ ] Works with host and device arrays
  • [ ] Optional array size parameter
  • [ ] Return value or output parameter
  • [ ] Optional initial value
  • [ ] Optional pin to queue

Example:

@cuda.reduce
def sum_reduce(a, b):
    return a + b
res = sum_reduce(arr)
sum_reduce = cuda.reduce(lambda a, b: a + b)

PokhodenkoSA avatar Jan 21 '21 09:01 PokhodenkoSA

Related issues:

  • https://github.com/IntelPython/numba-dppy/issues/71
  • https://github.com/IntelPython/numba-dppy/issues/78
  • https://github.com/IntelPython/numba-dppy/issues/96
  • https://github.com/IntelPython/numba-dppy/issues/93

PokhodenkoSA avatar Jan 21 '21 09:01 PokhodenkoSA