Internal API

Note

This is the documentation of Enzymes's internal API. The internal API is not subject to semantic versioning and may change at any time and without deprecation.

Enzyme.Compiler.EnzymeErrorType
EnzymeError

Common supertype for Enzyme-specific errors.

This type is made public so that downstream packages can add custom error hints for the most common exceptions thrown by Enzyme.

source
Enzyme.Compiler.call_same_with_inverted_arg_if_active!Method

Helper function for llvm-level rule generation. Will call the same function (and optional postprocessing), if the argument at index cmpidx isn't active. This takes into account runtime activity as a reason the value may not be active.

If postprocess_const is set, the original function will always be called, but the postprocessing will be conditionally gated as follows.

If the relevant input is active (and verified by runtime activity), postprocess(B, result, args) will run as normal Otherwise postprocess_const(B, result, args) will run

source
Enzyme.Compiler.link_split_existing!Method
link_split_existing!(mod::LLVM.Module, newmod::LLVM.Module)

Link newmod into mod like LLVM.link!(mod, newmod), but first rename any function that is defined in both modules. A function defined in newmod whose name already refers to a definition in mod is given a unique suffix in newmod before linking, so its definition is preserved as a distinct symbol instead of triggering a symbol multiply defined linker error.

source