diff options
author | Eli Schwartz <eschwartz93@gmail.com> | 2024-01-03 23:06:23 -0500 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-02-12 23:13:59 -0500 |
commit | 8ff25c0bcafac73a450a466c559ba59018e26437 (patch) | |
tree | 5fd2be83ead1e86df97c9d399cf61ad3a1b352ed | |
parent | cf35d9b4cebecd3e565d49e4d9f4a5366429463a (diff) | |
download | meson-8ff25c0bcafac73a450a466c559ba59018e26437.zip meson-8ff25c0bcafac73a450a466c559ba59018e26437.tar.gz meson-8ff25c0bcafac73a450a466c559ba59018e26437.tar.bz2 |
cuda module: fix type signature for oneshot function
It is only ever invoked once. It has a statically known signature based
on how it's used, so there's no good reason to allow it to accept any
defaults -- and defaulting to None messes with type safety.
Saturate is always given, so don't claim it is only sometimes.
-rw-r--r-- | mesonbuild/modules/cuda.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mesonbuild/modules/cuda.py b/mesonbuild/modules/cuda.py index 7cfd3a0..b062bbf 100644 --- a/mesonbuild/modules/cuda.py +++ b/mesonbuild/modules/cuda.py @@ -157,11 +157,11 @@ class CudaModule(NewExtensionModule): return cuda_version, arch_list, detected - def _filter_cuda_arch_list(self, cuda_arch_list, lo=None, hi=None, saturate=None): + def _filter_cuda_arch_list(self, cuda_arch_list, lo: str, hi: T.Optional[str], saturate: str) -> T.List[str]: """ Filter CUDA arch list (no codenames) for >= low and < hi architecture bounds, and deduplicate. - If saturate is provided, architectures >= hi are replaced with saturate. + Architectures >= hi are replaced with saturate. """ filtered_cuda_arch_list = [] @@ -170,8 +170,6 @@ class CudaModule(NewExtensionModule): if lo and version_compare(arch, '<' + lo): continue if hi and version_compare(arch, '>=' + hi): - if not saturate: - continue arch = saturate if arch not in filtered_cuda_arch_list: filtered_cuda_arch_list.append(arch) |