Routines

The following pages describe NumPy-compatible routines. These functions cover a subset of NumPy routines.

CUB backend for reduction routines

Some CuPy reduction routines, including sum(), min(), max(), argmin(), argmax(), and other functions built on top of them, can be accelerated by switching to the CUB backend. The switch can be toggled on or off at runtime by setting the bool cupy.cuda.cub_enabled, which is set to False by default. Note that while in general CUB-backed reductions are faster, there could be exceptions depending on the data layout. We recommend users to perform some benchmarks to determine whether CUB offers better performance or not.