CuPy-specific functions#

CuPy-specific functions are placed under cupyx namespace.

cupyx.rsqrt

Returns the reciprocal square root.

cupyx.scatter_add(a, slices, value)

Adds given values to specified elements of an array.

cupyx.scatter_max(a, slices, value)

Stores a maximum value of elements specified by indices to an array.

cupyx.scatter_min(a, slices, value)

Stores a minimum value of elements specified by indices to an array.

cupyx.empty_pinned(shape[, dtype, order])

Returns a new, uninitialized NumPy array with the given shape and dtype.

cupyx.empty_like_pinned(a[, dtype, order, ...])

Returns a new, uninitialized NumPy array with the same shape and dtype as those of the given array.

cupyx.zeros_pinned(shape[, dtype, order])

Returns a new, zero-initialized NumPy array with the given shape and dtype.

cupyx.zeros_like_pinned(a[, dtype, order, ...])

Returns a new, zero-initialized NumPy array with the same shape and dtype as those of the given array.

Profiling utilities#

cupyx.profiler.benchmark(func[, args, ...])

Timing utility for measuring time spent by both CPU and GPU.

cupyx.profiler.time_range([message, ...])

Mark function calls with ranges using NVTX/rocTX.

cupyx.profiler.profile()

Enable CUDA profiling during with statement.

DLPack utilities#

Below are helper functions for creating a cupy.ndarray from either a DLPack tensor or any object supporting the DLPack data exchange protocol. For further detail see DLPack.

cupy.from_dlpack(array)

Zero-copy conversion between array objects compliant with the DLPack data exchange protocol.

Automatic Kernel Parameters Optimizations (cupyx.optimizing)#

cupyx.optimizing.optimize(*[, key, path, ...])

Context manager that optimizes kernel launch parameters.