Error Classes#

Every exception raised by brainevent derives from BrainEventError, so a single except brainevent.BrainEventError clause catches all of them. The hierarchy is:

BrainEventError
├── MathError
├── UnsupportedOperationError
├── BenchmarkDataFnNotProvidedError
└── KernelError
    ├── KernelNotAvailableError
    ├── KernelFallbackExhaustedError
    ├── KernelExecutionError
    ├── KernelRegistrationError
    ├── KernelLoadError
    ├── CUDANotInstalledError
    ├── KernelCompilationError
    │   └── CompilationError
    │       └── HostCompilerIncompatibleError
    └── KernelToolchainError
        ├── NvccNotFoundError
        ├── HeaderNotFoundError
        ├── HostCompilerNotFoundError
        ├── GpuArchDetectionError
        └── UnsupportedArchError

Base#

BrainEventError

KernelError

Base exception for brainevent.

Array and Operation Errors#

MathError

Base exception for mathematical errors in brainevent operations.

UnsupportedOperationError

Raised when an operation is structurally meaningless for a representation.

BenchmarkDataFnNotProvidedError

Raised when benchmark() is called but no data function has been registered.

Kernel Dispatch and Execution Errors#

KernelNotAvailableError

Raised when a requested kernel backend is not installed or is version-incompatible.

KernelFallbackExhaustedError

Raised when all fallback kernel backends have been exhausted.

KernelExecutionError

Raised when a compiled kernel fails during execution at runtime.

KernelRegistrationError

JAX FFI target registration failed.

KernelLoadError

A compiled .so failed to load via dlopen (E-LOAD).

Kernel Compilation Errors#

KernelCompilationError

Raised when a kernel fails to compile on the target backend.

CompilationError(message[, compiler_output, ...])

CUDA or C++ compilation failed.

HostCompilerIncompatibleError(message[, ...])

Host C++ compiler version is not supported by this CUDA/nvcc (E-CXXVER).

Toolchain Errors#

Raised when the CUDA / C++ toolchain needed to build a kernel is missing or unusable. Each carries a stable E- diagnostic code in its message.

KernelToolchainError

Compilation toolchain missing or incompatible.

CUDANotInstalledError

Raised when a CUDA operation is requested but the package is not installed.

NvccNotFoundError

The CUDA compiler (nvcc) could not be located (E-NVCC).

HeaderNotFoundError

A required header (cuda_runtime.h / XLA FFI / brainevent) is missing (E-HDR).

HostCompilerNotFoundError

No host C++ compiler (g++/clang++) could be located (E-CXX).

GpuArchDetectionError

GPU compute capability could not be detected (E-ARCH).

UnsupportedArchError(message, *[, ...])

nvcc does not support the requested GPU architecture (E-ARCH-UNSUP).