The nvmath. module is experimental and potentially subject to future changes.
Device API utilities (nvmath. device)#
Overview#
nvmath-python provides the following device-side utilities.
Note
For most use cases, prefer the Complex and
Vector types and their instances (complex32,
complex64, complex128, half2, and half4). During compilation, they
resolve automatically to the matching underlying type: with numba-cuda, the
vector types provided by nvmath-python, and with numba-cuda-mlir, the compiler’s
native complex and vector types.
They also carry a host-side numpy dtype (the dtype property), so they can be used
for host allocation as well.
The remaining Numba vector types (float16x2 to uint32x4 and their *_type
variants) are supported only with the numba-cuda compiler. nvmath-python provides
them because numba-cuda does not expose all of the required vector types (for
example, the float16 vectors). The numba-cuda-mlir compiler exposes all of them
in the numba_cuda_mlir.cuda.vector_types module, so the
nvmath-python ones are neither needed nor supported there.
See Supported Compilers for an overview of the compiler support.
API Reference#
A helper function to get the default code type for link time optimization (LTO) on the current device. |
|
A helper function to get the default SM for mathdx types on the current device. |
|
|
Complex type that can be used to represent complex numbers both on host and device side. |
|
Vector type that can be used to represent vector values both on host and device side. |
Complex type that can be used to represent complex numbers both on host and device side. |
|
Complex type that can be used to represent complex numbers both on host and device side. |
|
Complex type that can be used to represent complex numbers both on host and device side. |
|
NumPy dtype object that encapsulates the np in device. |
|
NumPy dtype object that encapsulates the np in device. |
|
Vector type that can be used to represent vector values both on host and device side. |
|
Vector type that can be used to represent vector values both on host and device side. |
|
|
A Numba-compliant vector object for float16 with vector length 2. |
Numba type of |
|
|
A Numba-compliant vector object for float16 with vector length 4. |
Numba type of |
|
|
A Numba-compliant vector object for float32 with vector length 2. |
Numba type of |
|
|
A Numba-compliant vector object for float32 with vector length 4. |
Numba type of |
|
|
A Numba-compliant vector object for float64 with vector length 2. |
Numba type of |
|
|
A Numba-compliant vector object for float64 with vector length 4. |
Numba type of |
|
|
A Numba-compliant vector object for uint32 with vector length 4. |
Numba type of |
|
A namedtuple class that encapsulates the code version. |
|
A namedtuple class that encapsulates code type, version, and buffer. |
|
A namedtuple class that encapsulates code kind and compute capability. |
|
A namedtuple class that encapsulates the major and minor compute capability. |
|
A namedtuple class that encapsulates the dimensions for grids and blocks. |