Coverage for cuda / pathfinder / _dynamic_libs / load_dl_common.py: 90%
10 statements
« prev ^ index » next coverage.py v7.13.0, created at 2025-12-10 01:19 +0000
« prev ^ index » next coverage.py v7.13.0, created at 2025-12-10 01:19 +0000
1# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2# SPDX-License-Identifier: Apache-2.0
4from collections.abc import Callable
5from dataclasses import dataclass
7from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import DIRECT_DEPENDENCIES
10class DynamicLibNotFoundError(RuntimeError):
11 pass
14@dataclass
15class LoadedDL:
16 abs_path: str | None
17 was_already_loaded_from_elsewhere: bool
18 _handle_uint: int # Platform-agnostic unsigned pointer value
19 found_via: str
22def load_dependencies(libname: str, load_func: Callable[[str], LoadedDL]) -> None:
23 for dep in DIRECT_DEPENDENCIES.get(libname, ()):
24 load_func(dep)