cuda-python icon indicating copy to clipboard operation
cuda-python copied to clipboard

Add `cuda.core.utils.ProgramCacheResource`

Open leofang opened this issue 1 year ago • 0 comments

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.
        """
        ...

leofang avatar Oct 17 '24 00:10 leofang