Harmony18090's picture
Add source batch 2/11
76f9669 verified
raw
history blame
694 Bytes
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
from collections.abc import Callable
from dataclasses import dataclass
from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import DIRECT_DEPENDENCIES
class DynamicLibNotFoundError(RuntimeError):
pass
@dataclass
class LoadedDL:
abs_path: str | None
was_already_loaded_from_elsewhere: bool
_handle_uint: int # Platform-agnostic unsigned pointer value
found_via: str
def load_dependencies(libname: str, load_func: Callable[[str], LoadedDL]) -> None:
for dep in DIRECT_DEPENDENCIES.get(libname, ()):
load_func(dep)