sailfish.subdivide.lazy_reduce
- sailfish.subdivide.lazy_reduce(reduction, block, launches, contexts)[source]
Applies a reduction over a sequence of parallelizable device operations.
The reduction can be something like built-in max or min. The launches argument is a sequence of callables which trigger the asynchronous calculation and return a “token” (in the case of a cupy reduction, the token is a device array). The block argument is a callable which operates on the token, blocking until the underlying operation is completed, and then returns a value (block is probably built-in float). The contexts argument is a sequence of execution contexts which should switch to the device on which the respective launch callable was executed.