1010
1111from __future__ import annotations
1212
13- from cuda .pathfinder ._dynamic_libs .descriptor_catalog import DESCRIPTOR_CATALOG , is_supported_on_current_machine
14- from cuda .pathfinder ._dynamic_libs .lib_descriptor import LibDescriptor
13+ from cuda .pathfinder ._dynamic_libs .descriptor_catalog import DESCRIPTOR_CATALOG
1514from cuda .pathfinder ._utils .platform_aware import IS_WINDOWS
1615
1716_CTK_DESCRIPTORS = tuple (desc for desc in DESCRIPTOR_CATALOG if desc .packaged_with == "ctk" )
1817_OTHER_DESCRIPTORS = tuple (desc for desc in DESCRIPTOR_CATALOG if desc .packaged_with == "other" )
1918_DRIVER_DESCRIPTORS = tuple (desc for desc in DESCRIPTOR_CATALOG if desc .packaged_with == "driver" )
2019_NON_CTK_DESCRIPTORS = _OTHER_DESCRIPTORS + _DRIVER_DESCRIPTORS
2120
22-
23- def _has_supported_linux_sonames (desc : LibDescriptor ) -> bool :
24- return bool (desc .linux_sonames ) and is_supported_on_current_machine (desc )
25-
26-
27- def _has_supported_windows_dlls (desc : LibDescriptor ) -> bool :
28- return bool (desc .windows_dlls ) and is_supported_on_current_machine (desc )
29-
30-
31- SUPPORTED_LIBNAMES_COMMON = tuple (
32- desc .name for desc in _CTK_DESCRIPTORS if _has_supported_linux_sonames (desc ) and _has_supported_windows_dlls (desc )
33- )
21+ SUPPORTED_LIBNAMES_COMMON = tuple (desc .name for desc in _CTK_DESCRIPTORS if desc .linux_sonames and desc .windows_dlls )
3422SUPPORTED_LIBNAMES_LINUX_ONLY = tuple (
35- desc .name
36- for desc in _CTK_DESCRIPTORS
37- if _has_supported_linux_sonames (desc ) and not _has_supported_windows_dlls (desc )
23+ desc .name for desc in _CTK_DESCRIPTORS if desc .linux_sonames and not desc .windows_dlls
3824)
3925SUPPORTED_LIBNAMES_WINDOWS_ONLY = tuple (
40- desc .name
41- for desc in _CTK_DESCRIPTORS
42- if _has_supported_windows_dlls (desc ) and not _has_supported_linux_sonames (desc )
26+ desc .name for desc in _CTK_DESCRIPTORS if desc .windows_dlls and not desc .linux_sonames
4327)
4428
4529SUPPORTED_LIBNAMES_LINUX = SUPPORTED_LIBNAMES_COMMON + SUPPORTED_LIBNAMES_LINUX_ONLY
@@ -50,57 +34,37 @@ def _has_supported_windows_dlls(desc: LibDescriptor) -> bool:
5034DIRECT_DEPENDENCIES_CTK = {desc .name : desc .dependencies for desc in _CTK_DESCRIPTORS if desc .dependencies }
5135DIRECT_DEPENDENCIES = {desc .name : desc .dependencies for desc in DESCRIPTOR_CATALOG if desc .dependencies }
5236
53- SUPPORTED_LINUX_SONAMES_CTK = {
54- desc .name : desc .linux_sonames for desc in _CTK_DESCRIPTORS if _has_supported_linux_sonames (desc )
55- }
56- SUPPORTED_LINUX_SONAMES_OTHER = {
57- desc .name : desc .linux_sonames for desc in _OTHER_DESCRIPTORS if _has_supported_linux_sonames (desc )
58- }
59- SUPPORTED_LINUX_SONAMES_DRIVER = {
60- desc .name : desc .linux_sonames for desc in _DRIVER_DESCRIPTORS if _has_supported_linux_sonames (desc )
61- }
37+ SUPPORTED_LINUX_SONAMES_CTK = {desc .name : desc .linux_sonames for desc in _CTK_DESCRIPTORS if desc .linux_sonames }
38+ SUPPORTED_LINUX_SONAMES_OTHER = {desc .name : desc .linux_sonames for desc in _OTHER_DESCRIPTORS if desc .linux_sonames }
39+ SUPPORTED_LINUX_SONAMES_DRIVER = {desc .name : desc .linux_sonames for desc in _DRIVER_DESCRIPTORS if desc .linux_sonames }
6240SUPPORTED_LINUX_SONAMES = SUPPORTED_LINUX_SONAMES_CTK | SUPPORTED_LINUX_SONAMES_OTHER | SUPPORTED_LINUX_SONAMES_DRIVER
6341
64- SUPPORTED_WINDOWS_DLLS_CTK = {
65- desc .name : desc .windows_dlls for desc in _CTK_DESCRIPTORS if _has_supported_windows_dlls (desc )
66- }
67- SUPPORTED_WINDOWS_DLLS_OTHER = {
68- desc .name : desc .windows_dlls for desc in _OTHER_DESCRIPTORS if _has_supported_windows_dlls (desc )
69- }
70- SUPPORTED_WINDOWS_DLLS_DRIVER = {
71- desc .name : desc .windows_dlls for desc in _DRIVER_DESCRIPTORS if _has_supported_windows_dlls (desc )
72- }
42+ SUPPORTED_WINDOWS_DLLS_CTK = {desc .name : desc .windows_dlls for desc in _CTK_DESCRIPTORS if desc .windows_dlls }
43+ SUPPORTED_WINDOWS_DLLS_OTHER = {desc .name : desc .windows_dlls for desc in _OTHER_DESCRIPTORS if desc .windows_dlls }
44+ SUPPORTED_WINDOWS_DLLS_DRIVER = {desc .name : desc .windows_dlls for desc in _DRIVER_DESCRIPTORS if desc .windows_dlls }
7345SUPPORTED_WINDOWS_DLLS = SUPPORTED_WINDOWS_DLLS_CTK | SUPPORTED_WINDOWS_DLLS_OTHER | SUPPORTED_WINDOWS_DLLS_DRIVER
7446
7547LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY = tuple (
76- desc .name for desc in DESCRIPTOR_CATALOG if desc .requires_add_dll_directory and _has_supported_windows_dlls ( desc )
48+ desc .name for desc in DESCRIPTOR_CATALOG if desc .requires_add_dll_directory and desc . windows_dlls
7749)
7850LIBNAMES_REQUIRING_RTLD_DEEPBIND = tuple (
79- desc .name for desc in DESCRIPTOR_CATALOG if desc .requires_rtld_deepbind and _has_supported_linux_sonames ( desc )
51+ desc .name for desc in DESCRIPTOR_CATALOG if desc .requires_rtld_deepbind and desc . linux_sonames
8052)
8153
8254# Based on output of toolshed/make_site_packages_libdirs_linux.py
8355SITE_PACKAGES_LIBDIRS_LINUX_CTK = {
84- desc .name : desc .site_packages_linux
85- for desc in _CTK_DESCRIPTORS
86- if desc .site_packages_linux and _has_supported_linux_sonames (desc )
56+ desc .name : desc .site_packages_linux for desc in _CTK_DESCRIPTORS if desc .site_packages_linux
8757}
8858SITE_PACKAGES_LIBDIRS_LINUX_OTHER = {
89- desc .name : desc .site_packages_linux
90- for desc in _NON_CTK_DESCRIPTORS
91- if desc .site_packages_linux and _has_supported_linux_sonames (desc )
59+ desc .name : desc .site_packages_linux for desc in _NON_CTK_DESCRIPTORS if desc .site_packages_linux
9260}
9361SITE_PACKAGES_LIBDIRS_LINUX = SITE_PACKAGES_LIBDIRS_LINUX_CTK | SITE_PACKAGES_LIBDIRS_LINUX_OTHER
9462
9563SITE_PACKAGES_LIBDIRS_WINDOWS_CTK = {
96- desc .name : desc .site_packages_windows
97- for desc in _CTK_DESCRIPTORS
98- if desc .site_packages_windows and _has_supported_windows_dlls (desc )
64+ desc .name : desc .site_packages_windows for desc in _CTK_DESCRIPTORS if desc .site_packages_windows
9965}
10066SITE_PACKAGES_LIBDIRS_WINDOWS_OTHER = {
101- desc .name : desc .site_packages_windows
102- for desc in _NON_CTK_DESCRIPTORS
103- if desc .site_packages_windows and _has_supported_windows_dlls (desc )
67+ desc .name : desc .site_packages_windows for desc in _NON_CTK_DESCRIPTORS if desc .site_packages_windows
10468}
10569SITE_PACKAGES_LIBDIRS_WINDOWS = SITE_PACKAGES_LIBDIRS_WINDOWS_CTK | SITE_PACKAGES_LIBDIRS_WINDOWS_OTHER
10670
0 commit comments