cuda.core.utils.ProgramCacheResource#
- class cuda.core.utils.ProgramCacheResource#
Abstract base class for compiled-program caches.
Concrete implementations store and retrieve
ObjectCodeinstances keyed by arbitrary hashable objects. A typical key is produced bymake_program_cache_key(), but any hashable value is acceptable.Warning
Persistent backends use
picklefor serialization. Only read cache files that you trust — loading a cache from an untrusted source can execute arbitrary code. Cache directories should have the same access controls as any other sensitive build artifact.Note
Cache only bytes-backed
ObjectCodeinstances. Path-backed objects (created viaObjectCode.from_cubin("/path")) store the path, not the content — if the file is later modified or deleted, cache hits will return stale or broken data. Normalize to bytes before caching.Methods
- __init__()#
- get(
- key: Hashable,
- default: ObjectCode | None = None,
Return
self[key]ordefaultif absent.