Plugin Jit Module Registry#

template<typename Key, typename LoadedModule>
class PluginJitModuleRegistry#

Process-wide registry of driver-loaded plugin JIT modules, keyed by (CUDA context, key, digest). Entries are weak: a module stays loaded while at least one runner holds it and is loaded again on the next request after the last holder is gone. LoadedModule derives from PluginJitLoadedModule<Key>.

Public Functions

inline explicit PluginJitModuleRegistry(
char const *const name
) noexcept#
Parameters:

name – Error-message prefix, e.g. “NVFP4-A16 Blackwell GEMV JIT”.

template<typename BindFunctions>
inline std::shared_ptr<LoadedModule> load(
PluginJitKernel<Key> const &kernel,
BindFunctions &&bindFunctions
)#

Load kernel into the current CUDA context, or share the module already loaded there for the same key and digest. bindFunctions(LoadedModule&) resolves the entry points from loaded.module; if it throws, the module is unloaded and nothing is registered.

Establishes the primary context when none is current, so this is not capture-safe: call it from configurePlugin / onShapeChange / deserialization, never from enqueue.

Throws:

std::invalid_argument – when the cubin is not a native ELF image or its digest does not match, std::runtime_error when no CUDA context can be made current

template<typename Key>
struct PluginJitLoadedModule#

Base of every driver-loaded plugin JIT module: owns the CUmodule and remembers the context it was loaded in and the kernel it came from. Plugins derive from it and add their CUfunction handles, which PluginJitModuleRegistry::load fills through the bindFunctions callback.

Public Functions

PluginJitLoadedModule() = default#
PluginJitLoadedModule(PluginJitLoadedModule const&) = delete#
PluginJitLoadedModule &operator=(
PluginJitLoadedModule const&
) = delete#
inline ~PluginJitLoadedModule()#

Public Members

CUcontext context = {}#
CUmodule module = {}#
Key key = {}#
PluginJitDigest digest = {}#