magneticalc.Backend_Types

# ``magneticalc`.`Backend_Types``

module documentation

Backend_Types module.

Function | `backend_type_safe` | A valid backend type is passed through, but an invalid backend type converts to the default type.
Function | `backend_type_to_name` | Converts a backend type to a backend name.
Function | `get_cuda_available` | Checks if CUDA is available
Function | `get_jit_enabled` | Checks if JIT is enabled (or at least not explicitly disabled).
Constant | `BACKEND_TYPE_CUDA` | Map of backend types to their availability.
Constant | `BACKEND_TYPE_JIT` | Backend type: CUDA.
Variable | `Backend_Types_Available` | Map of backend types to names.
Variable | `Backend_Types_Names_Map` | Default backend type.

def backend_type_safe(backend_type: `int`) -> `int`:

A valid backend type is passed through, but an invalid backend type converts to the default type.

Parameters
backend_type: `int` | Backend type

Returns
`int` | Safe backend type

def backend_type_to_name(backend_type: `int`) -> `str`:

Converts a backend type to a backend name.

Parameters
backend_type: `int` | Backend type

Returns
`str` | Backend name

def get_cuda_available() -> `bool`:

Checks if CUDA is available

Returns
`bool` | True if CUDA available, False otherwise

def get_jit_enabled() -> `bool`:

Checks if JIT is enabled (or at least not explicitly disabled).

Returns
`bool` | True if JIT enabled, False otherwise

BACKEND_TYPE_CUDA: `int` =

Map of backend types to their availability.

Value
    1

BACKEND_TYPE_JIT: `int` =

Backend type: CUDA.

Value
    0

Backend_Types_Available =

Map of backend types to names.

Backend_Types_Names_Map =

Default backend type.