Device API utilities (nvmath.device)#

Overview#

nvmath-python provides the following device-side utilities.

API Reference#

current_device_lto()

A helper function to get the default code type for link time optimization (LTO) on the current device.

Complex(real_dtype)

Complex type that can be used to represent complex numbers both on host and device side.

Vector(real_dtype, size)

Vector type that can be used to represent vector numbers both on host and device side.

complex32

Complex type that can be used to represent complex numbers both on host and device side.

complex64

Complex type that can be used to represent complex numbers both on host and device side.

complex128

Complex type that can be used to represent complex numbers both on host and device side.

np_float16x2

NumPy dtype object that encapsulates the np in device.

np_float16x4

NumPy dtype object that encapsulates the np in device.

half2

Vector type that can be used to represent vector numbers both on host and device side.

half4

Vector type that can be used to represent vector numbers both on host and device side.

float16x2(x, y)

Create a Numba compliant vector object for float16 with vector length 2.

float16x4(x, y, z, w)

Create a Numba compliant vector object for float16 with vector length 4.

float32x2(x, y)

Create a Numba compliant vector object for float32 with vector length 2.

float64x2(x, y)

Create a Numba compliant vector object for float64 with vector length 2.

float16x2_type

A Numba compliant vector type object for float16 with vector length 2

float16x4_type

A Numba compliant vector type object for float16 with vector length 4

float32x2_type

A Numba compliant vector type object for float32 with vector length 2

float64x2_type

A Numba compliant vector type object for float64 with vector length 2

ISAVersion(major, minor)

A namedtuple class that encapsulates the code version.

Code(code_type, isa_version, data)

A namedtuple class that encapsulates code type, version, and buffer.

CodeType(kind, cc)

A namedtuple class that encapsulates code kind and compute capability.

ComputeCapability(major, minor)

A namedtuple class that encapsulates the major and minor compute capability.

Dim3([x, y, z])

A namedtuple class that encapsulates the dimensions for grids and blocks.