--------
Routines
--------

The following pages describe NumPy-compatible routines.
These functions cover a subset of
`NumPy routines <https://docs.scipy.org/doc/numpy/reference/routines.html>`_.

.. currentmodule:: cupy

.. toctree::
   :maxdepth: 2

   creation
   manipulation
   binary
   dtype
   fft
   functional
   indexing
   io
   linalg
   logic
   math
   pad
   polynomials
   random
   sorting
   statistics
   ext


CUB backend for reduction routines
----------------------------------
Some CuPy reduction routines, including :func:`~cupy.sum`, :func:`~cupy.min`, :func:`~cupy.max`,
:func:`~cupy.argmin`, :func:`~cupy.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 :data:`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.

.. _CUB: http://nvlabs.github.io/cub/

--------
Routines
--------

The following pages describe NumPy-compatible routines.
These functions cover a subset of
`NumPy routines <https://docs.scipy.org/doc/numpy/reference/routines.html>`_.

.. currentmodule:: cupy

.. toctree::
   :maxdepth: 2

   creation
   manipulation
   binary
   dtype
   fft
   functional
   indexing
   io
   linalg
   logic
   math
   pad
   polynomials
   random
   sorting
   statistics
   ext


CUB/cuTENSOR backend for reduction routines
----------------------------------
Some CuPy reduction routines, including :func:`~cupy.sum`, :func:`~cupy.min`, :func:`~cupy.max`,
:func:`~cupy.argmin`, :func:`~cupy.argmax`, and other functions built on top of them, can be
accelerated by switching to the `CUB`_ or `cuTENSOR`_ backend. These backends can be enabled
by setting ``CUPY_ACCELERATORS`` environement variable. Note that while in general the accelerated
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.

.. _CUB: https://nvlabs.github.io/cub/
.. _cuTENSOR: https://docs.nvidia.com/cuda/cutensor/index.html

Fix documents to reflect CUPY_ACCELERATORS
Fix documents to reflect CUPY_ACCELERATORS
