numba-dpex
numba-dpex copied to clipboard
`@reduce` decorator
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)
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