Expand description
Global kernel registry — load PTX once, cache modules/functions/streams.
Eliminates ~0.06-0.26ms overhead per kernel call from:
- CudaContext::new (driver init)
- CudaContext::load_module (PTX JIT compilation)
- CudaContext::new_stream (stream creation)
- cuModuleGetFunction (function lookup) — now cached after first call
Usage: let reg = AtlasRegistry::get_or_init(ordinal, &[(“gemm”, PTX_SRC), …])?; let func = reg.function(“gemm”, “dense_gemm_tc_bf16”)?; unsafe { reg.stream.launch_builder(&func).arg(&ptr).launch(cfg)?; } reg.stream.synchronize()?;
Re-exports§
pub use crate::cuda_host::CudaHost;pub use crate::cuda_host::host;pub use crate::cuda_host::release;
Structs§
- Atlas
Registry - The PTX/CUBIN modules for one loaded model.
- RawCuda
Func - Wrapper for raw CUfunction handle (Send+Sync safe — handles are context-wide).
Constants§
- CUDA_
ERROR_ DEINITIALIZED CUDA_ERROR_DEINITIALIZED. The driver tears the primary context down in its ownatexithandler, which can run before ourDropimpls do. Every module unload and every host free then reports this code.
Functions§
- cuda_
error_ text - Resolve a CUresult status code into
"<NAME>: <description>"via cuGetErrorName + cuGetErrorString. Returns “CUDA_UNKNOWN” / “(no message)” if the driver doesn’t recognize the code. - is_
teardown_ noop - Whether a CUresult means “the context is already gone, nothing to do”.