KernelEntry#
- class brainevent.KernelEntry(backend, platform, kernel_generator)[source]#
A registered kernel implementation for a specific backend and platform.
KernelEntryis a lightweight data class used internally byXLACustomKernelto store a single kernel implementation together with the backend and platform it targets.- Parameters:
backend (
str) – The backend name (e.g.,'numba','warp','pallas','triton','cuda_raw','numba_cuda').platform (
str) – The hardware platform name (e.g.,'cpu','gpu','tpu').kernel_generator (
Callable[...,Callable]) – A callable that accepts keyword arguments (forwarded from the primitivebindcall) and returns a concrete kernel function ready to be invoked with the input arrays.
See also
XLACustomKernelThe kernel manager that creates and stores
KernelEntryinstances.XLACustomKernel.def_kernelMethod used to register a new
KernelEntry.
Notes
KernelEntryinstances are created internally byXLACustomKernel.def_kernel()and stored in a nested dictionary keyed by(platform, backend). Users typically do not need to instantiate this class directly.Examples
>>> entry = KernelEntry( ... backend='numba', ... platform='cpu', ... kernel_generator=my_kernel_generator, ... ) >>> entry.backend 'numba' >>> entry.platform 'cpu'