HIPBackend#
- class brainevent.HIPBackend[source]#
Compile HIP sources for AMD GPUs (stub — not yet implemented).
To implement HIP support:
Add
detect_hip_toolchain()tokernix_toolchainthat locateshipccand the ROCm include directories.Implement HIP compilation logic in this class using
hipcc.Update
load_cuda_inline()(or addload_hip_inline) to selectHIPBackendwhenplatform="hip"is requested.
- compile_source(source, output_path, build_dir, **kwargs)[source]#
Compile preprocessed source code to a shared library.
- Parameters:
source (
str) – Preprocessed C++/CUDA source (user code + auto-generated FFI wrappers, as produced bypreprocess_source()).output_path (
str) – Desired path for the output shared library.build_dir (
str) – Directory for intermediate build artefacts.extra_cflags (list[str], optional) – Additional compiler flags.
extra_ldflags (list[str], optional) – Additional linker flags.
extra_include_paths (list[str], optional) – Additional header search paths.
verbose (bool) – Print the full compiler command.
**kwargs (
Any) – Backend-specific keyword arguments (e.g.gpu_archfor CUDA,optimization_level,use_fast_math).
- Returns:
Absolute path to the compiled shared library.
- Return type: