GPU Backend Tools Base Setup

Backends

Backend Functions

gpubackendtools.get_backend(backend_name: str) Backend

Get a backend by its name.

If the backend name is “cuda”, return a CUDA backend if any available. If the backend name is “gpu”, return a GPU backend if any available.

gpubackendtools.get_first_backend(backend_names: Sequence[str]) Backend

Get the first available backend from a list of backend names

gpubackendtools.has_backend(backend_name: str) bool

Test if a backend is available.

If the backend name is “cuda”, return true if any of “cuda11x” or “cuda12x” is available. If the backend name is “gpu”, return true if any GPU backend is available.

Exceptions