Compile#

class nvmath.device.random.Compile(
cc: ComputeCapability | None = None,
)[source]#

Compile the random device APIs with the specified compute capability.

The files and extension attributes should be used as the arguments for numba.cuda.jit() decorator in Numba kernels which use random device APIs.

Parameters:

cc – (optional) the compute capability specified as an object of type nvmath.device.ComputeCapability. If not specified, the default compute capability will be used.

Example

>>> from numba import cuda
>>> from nvmath.device import random
>>> compiled_apis = random.Compile()
>>> @cuda.jit(link=compiled_apis.files, extensions=compiled_apis.extension)
... def kernel():
...     pass  # use random device APIs here

Methods

__init__(
cc: ComputeCapability | None = None,
)[source]#

Attributes

extension#

The extension needed to use random device APIs with Numba kernels.

files#

The data needed to link random device APIs with Numba kernels.