Custom kernels

Custom kernels#

Information-oriented reference for the raw C++/CUDA kernel toolchain (see The custom-kernel architecture for the overview).

Use this reference while implementing or maintaining a native kernel that is loaded through brainevent. Begin with the argument specification page to understand how Python- side inputs and outputs are described to the wrapper generator. Consult the C++ API for the tensor types and helper interfaces available inside your source. The compiler options page explains settings you can adjust when building CUDA code, and the caching page describes how compiled artifacts are identified and reused. These pages are most useful alongside a working example from the custom operator tutorials or the raw compilation how-to guide. Before changing a build setting, check which part of the compilation it affects and whether it changes the resulting cache entry. When diagnosing a problem, distinguish the argument interface, source implementation, compiler configuration, and artifact reuse so you can consult the relevant reference first.

Explore this section#

Argument specifications

Describe kernel parameters for generated XLA FFI wrappers.

arg_spec System
C++ API

Look up tensor types and helpers available to native kernels.

C++ API
Compiler options

Inspect CUDA compilation and optimization settings.

Compiler Options
Caching

Understand cache keys, artifact storage, and cache configuration.

Caching