mojolearn.vendor#

mojolearn.vendor()[source]#

The GPU programming interface of the binaries this process runs.

The answer is read back from the loaded binaries.

Returns:

{“metal”, “cuda”, “hip”, “cpu”} or None – "metal" for Apple GPUs, "cuda" for NVIDIA, "hip" for AMD, "cpu" on a CPU-only install. None only for binaries too old to report it.

Raises:

RuntimeError – If the loaded binaries disagree with the vendor directory they were loaded from (a broken install).

Examples

>>> import mojolearn
>>> mojolearn.vendor() in ("metal", "cuda", "hip", "cpu")
True