diff --git a/src/bashi/filter_software_dependency.py b/src/bashi/filter_software_dependency.py index 6244a7e..20cd05d 100644 --- a/src/bashi/filter_software_dependency.py +++ b/src/bashi/filter_software_dependency.py @@ -13,6 +13,7 @@ from bashi.types import ParameterValueTuple from bashi.globals import * # pylint: disable=wildcard-import,unused-wildcard-import from bashi.utils import reason +from bashi.versions import get_oldest_supporting_clang_version_for_cuda def __ubuntu_version_to_string(version: pkv.Version) -> str: @@ -74,6 +75,9 @@ def software_dependency_filter( Returns: bool: True, if parameter-value-tuple is valid. """ + # pylint: disable=too-many-branches + # pylint: disable=too-many-return-statements + # pylint: disable=too-many-statements # Rule: d1 # GCC 6 and older is not available in Ubuntu 20.04 and newer @@ -91,7 +95,7 @@ def software_dependency_filter( return False # Rule: d2 - # CMAKE 3.19 and older is not available with clang cuda as device and host compiler + # CMAKE 3.19 and older is not available with clang-cuda as device and host compiler if CMAKE in row and row[CMAKE].version <= pkv.parse("3.18"): for compiler_type in (HOST_COMPILER, DEVICE_COMPILER): @@ -116,4 +120,40 @@ def software_dependency_filter( "older than 20.04", ) return False + + # Rule: d4 + # Ubuntu 20.04 and newer is not available with CUDA older than 11 + + if UBUNTU in row and row[UBUNTU].version >= pkv.parse("20.04"): + if ALPAKA_ACC_GPU_CUDA_ENABLE in row and row[ALPAKA_ACC_GPU_CUDA_ENABLE].version != OFF_VER: + if row[ALPAKA_ACC_GPU_CUDA_ENABLE].version < pkv.parse("11.0"): + reason( + output, + f"CUDA {row[ALPAKA_ACC_GPU_CUDA_ENABLE].version} " + "is not available in Ubuntu " + f"{__ubuntu_version_to_string(row[UBUNTU].version)}", + ) + return False + if DEVICE_COMPILER in row and row[DEVICE_COMPILER].name == NVCC: + if row[DEVICE_COMPILER].version < pkv.parse("11.0"): + reason( + output, + f"NVCC {row[DEVICE_COMPILER].version} " + "is not available in Ubuntu " + f"{__ubuntu_version_to_string(row[UBUNTU].version)}", + ) + return False + for compiler_type in (HOST_COMPILER, DEVICE_COMPILER): + if compiler_type in row and row[compiler_type].name == CLANG_CUDA: + if row[compiler_type].version < get_oldest_supporting_clang_version_for_cuda( + "11.0" + ): + reason( + output, + f"{__pretty_name_compiler(compiler_type)}" + f" clang-cuda {row[compiler_type].version} " + "is not available in Ubuntu " + f"{__ubuntu_version_to_string(row[UBUNTU].version)}", + ) + return False return True diff --git a/src/bashi/results.py b/src/bashi/results.py index cfcc20f..fa391df 100644 --- a/src/bashi/results.py +++ b/src/bashi/results.py @@ -82,6 +82,7 @@ def get_expected_bashi_parameter_value_pairs( _remove_all_rocm_images_older_than_ubuntu2004_based( param_val_pair_list, removed_param_val_pair_list ) + _remove_unsupported_cuda_versions_for_ubuntu(param_val_pair_list, removed_param_val_pair_list) return (param_val_pair_list, removed_param_val_pair_list) @@ -861,3 +862,49 @@ def _remove_all_rocm_images_older_than_ubuntu2004_based( parameter2=compiler_type, value_name2=HIPCC, ) + + +def _remove_unsupported_cuda_versions_for_ubuntu( + parameter_value_pairs: List[ParameterValuePair], + removed_parameter_value_pairs: List[ParameterValuePair], +): + remove_parameter_value_pairs_ranges( + parameter_value_pairs, + removed_parameter_value_pairs, + parameter1=UBUNTU, + value_name1=UBUNTU, + value_min_version1=20.04, + parameter2=ALPAKA_ACC_GPU_CUDA_ENABLE, + value_name2=ALPAKA_ACC_GPU_CUDA_ENABLE, + value_min_version2=OFF, + value_min_version2_inclusive=False, + value_max_version2=11, + value_max_version2_inclusive=False, + ) + remove_parameter_value_pairs_ranges( + parameter_value_pairs, + removed_parameter_value_pairs, + parameter1=UBUNTU, + value_name1=UBUNTU, + value_min_version1=20.04, + parameter2=DEVICE_COMPILER, + value_name2=NVCC, + value_min_version2=OFF, + value_min_version2_inclusive=False, + value_max_version2=11, + value_max_version2_inclusive=False, + ) + for compiler_type in (HOST_COMPILER, DEVICE_COMPILER): + remove_parameter_value_pairs_ranges( + parameter_value_pairs, + removed_parameter_value_pairs, + parameter1=UBUNTU, + value_name1=UBUNTU, + value_min_version1=20.04, + parameter2=compiler_type, + value_name2=CLANG_CUDA, + value_min_version2=OFF, + value_min_version2_inclusive=False, + value_max_version2=12, + value_max_version2_inclusive=False, + ) diff --git a/src/bashi/versions.py b/src/bashi/versions.py index 8f8e1d0..7ad03af 100644 --- a/src/bashi/versions.py +++ b/src/bashi/versions.py @@ -232,3 +232,33 @@ def is_supported_version(name: ValueName, version: ValueVersion) -> bool: return True return False + + +def get_oldest_supporting_clang_version_for_cuda( + cuda_version: str, + clang_cuda_max_cuda_version: List[ClangCudaSDKSupport] = copy.deepcopy( + CLANG_CUDA_MAX_CUDA_VERSION + ), +) -> packaging.version.Version: + """Returns the first and oldest Clang-CUDA version which supports a given CUDA version. + Args: + cuda_version (str): CUDA SKD version + clang_cuda_max_cuda_version (List[ClangCudaSDKSupport], optional): List Clang version with + the maximum supported CUDA SDK version. Defaults to CLANG_CUDA_MAX_CUDA_VERSION. + Returns: + packaging.version.Version: Returns the first and oldest Clang version which supports the + given CUDA SDK version. Returns version 0, if no version supports the CUDA SDK. + """ + parsed_cuda_ver = pkv.parse(cuda_version) + # sort the list by the Clang version starting the smallest version + # luckily we can assume that the CUDA SDK version is also sorted starting with the smallest + # version, because a newer Clang version will also support all version like before plus new + # versions + clang_cuda_max_cuda_version.sort() + + for sdk_support in clang_cuda_max_cuda_version: + if sdk_support.cuda >= parsed_cuda_ver: + return sdk_support.clang_cuda + + # return version 0 as not available + return OFF_VER diff --git a/tests/test_filter_software_dependency.py b/tests/test_filter_software_dependency.py index 20419f1..043515d 100644 --- a/tests/test_filter_software_dependency.py +++ b/tests/test_filter_software_dependency.py @@ -190,7 +190,7 @@ def test_not_valid_cmake_versions_for_clangcuda_d2(self): f"device compiler CLANG_CUDA is not available in CMAKE {cmake_version}", ) - def test_valid_ROCm_images_Ubuntu2004_based_d4(self): + def test_valid_ROCm_images_Ubuntu2004_based_d3(self): for UBUNTU_version in ["20.04", "22.04", "21.04"]: self.assertTrue( software_dependency_filter_typechecked( @@ -227,7 +227,7 @@ def test_valid_ROCm_images_Ubuntu2004_based_d4(self): ), ) - def test_non_valid_ROCm_images_Ubuntu2004_based_d4(self): + def test_non_valid_ROCm_images_Ubuntu2004_based_d3(self): for UBUNTU_version in ["16.04", "18.04", "19.04"]: reason_msg = io.StringIO() self.assertFalse( @@ -302,3 +302,297 @@ def test_non_valid_ROCm_images_Ubuntu2004_based_d4(self): error_msg, f"{test_row}", ) + + def test_valid_cuda_versions_for_ubuntu_d4(self): + for CUDA_version in [11.1, 11.4, 15]: + self.assertTrue( + software_dependency_filter_typechecked( + OD( + { + ALPAKA_ACC_GPU_CUDA_ENABLE: ppv( + (ALPAKA_ACC_GPU_CUDA_ENABLE, CUDA_version) + ), + UBUNTU: ppv((UBUNTU, "22.04")), + } + ), + ) + ) + + for CUDA_version in [11.2, 11.4, 15]: + self.assertTrue( + software_dependency_filter_typechecked( + OD( + { + ALPAKA_ACC_GPU_CUDA_ENABLE: ppv( + (ALPAKA_ACC_GPU_CUDA_ENABLE, CUDA_version) + ), + UBUNTU: ppv((UBUNTU, "20.04")), + } + ), + ) + ) + for CUDA_version in [2, 6, 10.1, 10.2, 11.4, 15]: + self.assertTrue( + software_dependency_filter_typechecked( + OD( + { + ALPAKA_ACC_GPU_CUDA_ENABLE: ppv( + (ALPAKA_ACC_GPU_CUDA_ENABLE, CUDA_version) + ), + UBUNTU: ppv((UBUNTU, "18.04")), + } + ), + ) + ) + + for nvcc_version in [2, 6, 10.1, 10.2, 11.4, 15]: + self.assertTrue( + software_dependency_filter_typechecked( + OD( + { + DEVICE_COMPILER: ppv((NVCC, nvcc_version)), + UBUNTU: ppv((UBUNTU, "18.04")), + } + ), + ) + ) + for nvcc_version in [11.1, 11.2, 11.4, 15]: + self.assertTrue( + software_dependency_filter_typechecked( + OD( + { + DEVICE_COMPILER: ppv((NVCC, nvcc_version)), + UBUNTU: ppv((UBUNTU, "20.04")), + } + ), + ) + ) + for nvcc_version in [11.1, 11.2, 11.4, 15]: + self.assertTrue( + software_dependency_filter_typechecked( + OD( + { + DEVICE_COMPILER: ppv((NVCC, nvcc_version)), + UBUNTU: ppv((UBUNTU, "22.04")), + } + ), + ) + ) + for clang_cuda_version in [2, 6, 10.1, 10.2, 11, 12.4, 15]: + self.assertTrue( + software_dependency_filter_typechecked( + OD( + { + DEVICE_COMPILER: ppv((CLANG_CUDA, clang_cuda_version)), + UBUNTU: ppv((UBUNTU, "18.04")), + } + ), + ) + ) + for clang_cuda_version in [12, 15, 27]: + self.assertTrue( + software_dependency_filter_typechecked( + OD( + { + DEVICE_COMPILER: ppv((CLANG_CUDA, clang_cuda_version)), + UBUNTU: ppv((UBUNTU, "20.04")), + } + ), + ) + ) + for clang_cuda_version in [12, 15, 27]: + self.assertTrue( + software_dependency_filter_typechecked( + OD( + { + DEVICE_COMPILER: ppv((CLANG_CUDA, clang_cuda_version)), + UBUNTU: ppv((UBUNTU, "22.04")), + } + ), + ) + ) + for clang_cuda_version in [2, 6, 10.1, 10.2, 11, 12.4, 15]: + self.assertTrue( + software_dependency_filter_typechecked( + OD( + { + HOST_COMPILER: ppv((CLANG_CUDA, clang_cuda_version)), + UBUNTU: ppv((UBUNTU, "18.04")), + } + ), + ) + ) + for clang_cuda_version in [12, 15, 27]: + self.assertTrue( + software_dependency_filter_typechecked( + OD( + { + HOST_COMPILER: ppv((CLANG_CUDA, clang_cuda_version)), + UBUNTU: ppv((UBUNTU, "20.04")), + } + ), + ) + ) + for clang_cuda_version in [12, 17, 27]: + self.assertTrue( + software_dependency_filter_typechecked( + OD( + { + HOST_COMPILER: ppv((CLANG_CUDA, clang_cuda_version)), + UBUNTU: ppv((UBUNTU, "22.04")), + } + ), + ) + ) + + def test_not_valid_cuda_versions_for_ubuntu_d4(self): + for CUDA_version in [1, 6, 10.1]: + reason_msg = io.StringIO() + self.assertFalse( + software_dependency_filter_typechecked( + OD( + { + ALPAKA_ACC_GPU_CUDA_ENABLE: ppv( + (ALPAKA_ACC_GPU_CUDA_ENABLE, CUDA_version) + ), + UBUNTU: ppv((UBUNTU, "20.04")), + } + ), + reason_msg, + ), + f"CUDA {CUDA_version} is not available in Ubuntu 20.04", + ) + self.assertEqual( + reason_msg.getvalue(), + f"CUDA {CUDA_version} is not available in Ubuntu 20.04", + ) + for CUDA_version in [1, 6, 10.1]: + reason_msg = io.StringIO() + self.assertFalse( + software_dependency_filter_typechecked( + OD( + { + ALPAKA_ACC_GPU_CUDA_ENABLE: ppv( + (ALPAKA_ACC_GPU_CUDA_ENABLE, CUDA_version) + ), + UBUNTU: ppv((UBUNTU, "22.04")), + } + ), + reason_msg, + ), + f"CUDA {CUDA_version} is not available in Ubuntu 22.04", + ) + self.assertEqual( + reason_msg.getvalue(), + f"CUDA {CUDA_version} is not available in Ubuntu 22.04", + ) + for nvcc_version in [1, 6, 10.1]: + reason_msg = io.StringIO() + self.assertFalse( + software_dependency_filter_typechecked( + OD( + { + DEVICE_COMPILER: ppv((NVCC, nvcc_version)), + UBUNTU: ppv((UBUNTU, "20.04")), + } + ), + reason_msg, + ), + f"NVCC {nvcc_version} is not available in Ubuntu 20.04", + ) + self.assertEqual( + reason_msg.getvalue(), + f"NVCC {nvcc_version} is not available in Ubuntu 20.04", + ) + for nvcc_version in [1, 6, 10.1]: + reason_msg = io.StringIO() + self.assertFalse( + software_dependency_filter_typechecked( + OD( + { + DEVICE_COMPILER: ppv((NVCC, nvcc_version)), + UBUNTU: ppv((UBUNTU, "22.04")), + } + ), + reason_msg, + ), + f"NVCC {nvcc_version} is not available in Ubuntu 22.04", + ) + self.assertEqual( + reason_msg.getvalue(), + f"NVCC {nvcc_version} is not available in Ubuntu 22.04", + ) + + for clang_cuda_version in [1, 6, 10.1]: + reason_msg = io.StringIO() + self.assertFalse( + software_dependency_filter_typechecked( + OD( + { + DEVICE_COMPILER: ppv((CLANG_CUDA, clang_cuda_version)), + UBUNTU: ppv((UBUNTU, "22.04")), + } + ), + reason_msg, + ), + f"device compiler clang-cuda {clang_cuda_version} is not available in Ubuntu 22.04", + ) + self.assertEqual( + reason_msg.getvalue(), + f"device compiler clang-cuda {clang_cuda_version} is not available in Ubuntu 22.04", + ) + for clang_cuda_version in [1, 6, 10.1]: + reason_msg = io.StringIO() + self.assertFalse( + software_dependency_filter_typechecked( + OD( + { + HOST_COMPILER: ppv((CLANG_CUDA, clang_cuda_version)), + UBUNTU: ppv((UBUNTU, "22.04")), + } + ), + reason_msg, + ), + f"host compiler clang-cuda {clang_cuda_version} is not available in Ubuntu 22.04", + ) + self.assertEqual( + reason_msg.getvalue(), + f"host compiler clang-cuda {clang_cuda_version} is not available in Ubuntu 22.04", + ) + + for clang_cuda_version in [1, 6, 10.1]: + reason_msg = io.StringIO() + self.assertFalse( + software_dependency_filter_typechecked( + OD( + { + DEVICE_COMPILER: ppv((CLANG_CUDA, clang_cuda_version)), + UBUNTU: ppv((UBUNTU, "20.04")), + } + ), + reason_msg, + ), + f"device compiler clang-cuda {clang_cuda_version} is not available in Ubuntu 20.04", + ) + self.assertEqual( + reason_msg.getvalue(), + f"device compiler clang-cuda {clang_cuda_version} is not available in Ubuntu 20.04", + ) + for clang_cuda_version in [1, 6, 10.1]: + reason_msg = io.StringIO() + self.assertFalse( + software_dependency_filter_typechecked( + OD( + { + HOST_COMPILER: ppv((CLANG_CUDA, clang_cuda_version)), + UBUNTU: ppv((UBUNTU, "20.04")), + } + ), + reason_msg, + ), + f"host compiler clang-cuda {clang_cuda_version} is not available in Ubuntu 20.04", + ) + self.assertEqual( + reason_msg.getvalue(), + f"host compiler clang-cuda {clang_cuda_version} is not available in Ubuntu 20.04", + ) diff --git a/tests/test_get_max_supported_clang_cuda_ver.py b/tests/test_get_max_supported_clang_cuda_ver.py new file mode 100644 index 0000000..abc5856 --- /dev/null +++ b/tests/test_get_max_supported_clang_cuda_ver.py @@ -0,0 +1,39 @@ +# pylint: disable=missing-docstring + +import unittest +import random +import packaging.version as pkv +from typing import List +from bashi.versions import ClangCudaSDKSupport, get_oldest_supporting_clang_version_for_cuda + + +class TestgetOldestSupportingClangVersionForCuda(unittest.TestCase): + def test_get_oldest_supporting_clang_version_for_cuda(self): + clang_cuda_max_cuda_version: List[ClangCudaSDKSupport] = [ + ClangCudaSDKSupport("7", "9.2"), + ClangCudaSDKSupport("8", "10.0"), + ClangCudaSDKSupport("10", "10.1"), + ClangCudaSDKSupport("12", "11.0"), + ClangCudaSDKSupport("13", "11.2"), + ClangCudaSDKSupport("14", "11.5"), + ClangCudaSDKSupport("16", "11.8"), + ClangCudaSDKSupport("17", "12.1"), + ] + # shuffle list, because we should not assume a specific ordering + random.shuffle(clang_cuda_max_cuda_version) + + for cuda_version, expected_clang_cuda in [ + ("11.0", "12"), + ("12.0", "17"), + ("11.7", "16"), + ("99.9", "0"), + ("4", "7"), + ("10.2", "12"), + ]: + self.assertEqual( + get_oldest_supporting_clang_version_for_cuda( + cuda_version, clang_cuda_max_cuda_version + ), + pkv.parse(expected_clang_cuda), + f"\ngiven CUDA version: {cuda_version}\nexpected Clang version: {expected_clang_cuda}", + ) diff --git a/tests/test_results.py b/tests/test_results.py index b85abcd..e5fb220 100644 --- a/tests/test_results.py +++ b/tests/test_results.py @@ -46,6 +46,7 @@ _remove_unsupported_gcc_versions_for_ubuntu2004, _remove_unsupported_cmake_versions_for_clangcuda, _remove_all_rocm_images_older_than_ubuntu2004_based, + _remove_unsupported_cuda_versions_for_ubuntu, ) from bashi.versions import NvccHostSupport, NVCC_GCC_MAX_VERSION @@ -2579,3 +2580,250 @@ def test_remove_all_rocm_images_older_than_ubuntu2004_based(self): expected_results, create_diff_parameter_value_pairs(test_param_value_pairs, expected_results), ) + + def test_remove_unsupported_cuda_versions_for_ubuntu(self): + test_param_value_pairs: List[ParameterValuePair] = parse_expected_val_pairs( + [ + OD({HOST_COMPILER: (GCC, 12), UBUNTU: (UBUNTU, 22.04)}), + OD({HOST_COMPILER: (CLANG_CUDA, 14), CMAKE: (CMAKE, "3.19")}), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, "10.1"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "22.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, "10.1"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "22.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, "12"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "18.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, "10.1"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, "10.2"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, "11"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, "11.1"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, "14.1"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, "7.4"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, OFF), + } + ), + OD( + { + UBUNTU: (UBUNTU, "18.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, OFF), + } + ), + OD( + { + UBUNTU: (UBUNTU, "18.04"), + DEVICE_COMPILER: (NVCC, "11.2"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + DEVICE_COMPILER: (NVCC, "12"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + DEVICE_COMPILER: (NVCC, "10.1"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "22.04"), + DEVICE_COMPILER: (NVCC, "10"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + DEVICE_COMPILER: (CLANG_CUDA, "10"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + DEVICE_COMPILER: (CLANG_CUDA, "10.2"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "18.04"), + DEVICE_COMPILER: (CLANG_CUDA, "11"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "22.04"), + DEVICE_COMPILER: (CLANG_CUDA, "12"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + DEVICE_COMPILER: (CLANG_CUDA, "13"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "18.04"), + DEVICE_COMPILER: (NVCC, "10.2"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + DEVICE_COMPILER: (NVCC, "10.2"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + DEVICE_COMPILER: (NVCC, "11"), + } + ), + ] + ) + expected_results = parse_expected_val_pairs( + [ + OD( + { + UBUNTU: (UBUNTU, "20.04"), + DEVICE_COMPILER: (NVCC, "11"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, "11"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "18.04"), + DEVICE_COMPILER: (CLANG_CUDA, "11"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "22.04"), + DEVICE_COMPILER: (CLANG_CUDA, "12"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + DEVICE_COMPILER: (CLANG_CUDA, "13"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "18.04"), + DEVICE_COMPILER: (NVCC, "10.2"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "18.04"), + DEVICE_COMPILER: (NVCC, "11.2"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + DEVICE_COMPILER: (NVCC, "12"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "22.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, "12"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, OFF), + } + ), + OD( + { + UBUNTU: (UBUNTU, "18.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, OFF), + } + ), + OD( + { + UBUNTU: (UBUNTU, "18.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, "10.1"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, "14.1"), + } + ), + OD( + { + UBUNTU: (UBUNTU, "20.04"), + ALPAKA_ACC_GPU_CUDA_ENABLE: (ALPAKA_ACC_GPU_CUDA_ENABLE, "11.1"), + } + ), + OD({HOST_COMPILER: (GCC, 12), UBUNTU: (UBUNTU, 22.04)}), + OD({HOST_COMPILER: (CLANG_CUDA, 14), CMAKE: (CMAKE, "3.19")}), + ] + ) + default_remove_test( + _remove_unsupported_cuda_versions_for_ubuntu, + test_param_value_pairs, + expected_results, + self, + ) + self.assertEqual( + test_param_value_pairs, + expected_results, + create_diff_parameter_value_pairs(test_param_value_pairs, expected_results), + )