Coverage for cuda / core / utils / _program_cache / __init__.py: 100.00%
6 statements
« prev ^ index » next coverage.py v7.14.0, created at 2026-05-22 01:37 +0000
« prev ^ index » next coverage.py v7.14.0, created at 2026-05-22 01:37 +0000
1# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2#
3# SPDX-License-Identifier: Apache-2.0
5"""Persistent program cache for cuda.core.
7Public surface:
9* :class:`ProgramCacheResource` -- bytes-in / bytes-out ABC.
10* :class:`InMemoryProgramCache` -- thread-safe LRU dict-backed cache.
11* :class:`FileStreamProgramCache` -- atomic, multi-process directory cache.
12* :func:`make_program_cache_key` -- key derivation for arbitrary
13 ``Program`` configurations.
15The package is split into submodules by concern. Tests that need to
16monkeypatch internals (Windows flag, version probes, helpers, ...)
17should reach into the owning submodule (e.g.
18``_program_cache._file_stream._IS_WINDOWS``,
19``_program_cache._keys._linker_backend_and_version``) rather than the
20package object: the symbols re-exported here are only convenience
21aliases and don't intercept calls within the submodules.
22"""
24from __future__ import annotations
26from ._abc import ProgramCacheResource
27from ._file_stream import FileStreamProgramCache
28from ._in_memory import InMemoryProgramCache
29from ._keys import make_program_cache_key
31__all__ = [
32 "FileStreamProgramCache",
33 "InMemoryProgramCache",
34 "ProgramCacheResource",
35 "make_program_cache_key",
36]