CUDABackend#

class brainevent.CUDABackend(toolchain)[source]#

Compile CUDA sources directly with nvcc.

Parameters:

toolchain (CudaToolchain) – Detected CUDA toolchain (from detect_toolchain()).

compile_source(source, output_path, build_dir, *, extra_cuda_cflags=None, extra_ldflags=None, extra_include_paths=None, verbose=False, gpu_arch='sm_80', optimization_level=3, use_fast_math=False, **kwargs)[source]#

Compile preprocessed source to .so directly with nvcc.

Return type:

str

Notes

Each element of extra_ldflags is treated as a single, already-split linker token (the caller is responsible for splitting, exactly as if it were one shlex-split argv entry). Every element is forwarded to the host linker unchanged via one -Xlinker <token> pair, so a value such as "-L/path with spaces" reaches the linker as a single argument. This matches the CPPBackend semantics, where each element is likewise one already-split token passed straight through.

platform_name: str = 'cuda'#

Human-readable platform identifier, e.g. "cuda", "cpu", "hip".