Skip to content

Commit 1e5097c

Browse files
authored
Fix accident in cuda_bindings/cuda/bindings/_path_finder/supported_libs.py (#655)
* Fix accident discovered in passing. * Add test_libname_dict_values_are_unique()
1 parent ed884c9 commit 1e5097c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

cuda_bindings/cuda/bindings/_path_finder/supported_libs.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,6 @@
256256
"cufft": (
257257
"cufft64_10.dll",
258258
"cufft64_11.dll",
259-
"cufftw64_10.dll",
260-
"cufftw64_11.dll",
261259
),
262260
"cufftw": (
263261
"cufftw64_10.dll",

cuda_bindings/tests/test_path_finder_load.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ def test_all_libnames_windows_dlls_consistency():
3030
assert tuple(sorted(ALL_LIBNAMES_WINDOWS)) == tuple(sorted(supported_libs.SUPPORTED_WINDOWS_DLLS.keys()))
3131

3232

33+
@pytest.mark.parametrize("dict_name", ["SUPPORTED_LINUX_SONAMES", "SUPPORTED_WINDOWS_DLLS"])
34+
def test_libname_dict_values_are_unique(dict_name):
35+
libname_dict = getattr(supported_libs, dict_name)
36+
libname_for_value = {}
37+
for libname, values in libname_dict.items():
38+
for value in values:
39+
prev_libname = libname_for_value.get(value)
40+
if prev_libname is not None:
41+
raise RuntimeError(f"Multiple libnames for {value!r}: {prev_libname}, {libname}")
42+
libname_for_value[value] = libname
43+
44+
3345
def test_all_libnames_libnames_requiring_os_add_dll_directory_consistency():
3446
assert not (set(supported_libs.LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY) - set(ALL_LIBNAMES_WINDOWS))
3547

0 commit comments

Comments
 (0)