cuda-python
cuda-python copied to clipboard
Add `cuda.core.utils.ProgramCacheResource`
This is the ABC class that all concrete cache classes should inherit/overwrite:
class ProgramCacheResource(abc.ABC):
@abc.abstractmethod
def __getitem__(self, key: Any) -> Module:
"""Retrieve the cached Module instance. key should be a hashable
object.
"""
...
@abc.abstractmethod
def __setitem__(self, key: Any, val: Module):
"""Cache a Module instance. key should be a hashable object.
"""
...