diff --git a/src/bashi/filter_compiler.py b/src/bashi/filter_compiler.py index f79c2f1..b082487 100644 --- a/src/bashi/filter_compiler.py +++ b/src/bashi/filter_compiler.py @@ -199,9 +199,13 @@ def compiler_filter( reason(output, "hipcc does not support the CUDA backend.") return False # Rule: c19 - # + # all ROCm images are Ubuntu 20.04 based or newer + # realted to rule d3 if UBUNTU in row and row[UBUNTU].version < pkv.parse("20.04"): - reason(output, "hipcc does not support UBUNTU as compiler older than 20.04") + reason( + output, + "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", + ) return False if compiler in row and row[compiler].name == ICPX: diff --git a/src/bashi/filter_software_dependency.py b/src/bashi/filter_software_dependency.py index d939939..d816345 100644 --- a/src/bashi/filter_software_dependency.py +++ b/src/bashi/filter_software_dependency.py @@ -103,8 +103,9 @@ def software_dependency_filter( f"{row[CMAKE].version}", ) return False - # Rule: d4 - # all ROCm images are Ubuntu 20.04 based + # Rule: d3 + # all ROCm images are Ubuntu 20.04 based or newer + # realted to rule c19 if UBUNTU in row and row[UBUNTU].version < pkv.parse("20.04"): if ALPAKA_ACC_GPU_HIP_ENABLE in row and row[ALPAKA_ACC_GPU_HIP_ENABLE].version != OFF_VER: diff --git a/src/bashi/results.py b/src/bashi/results.py index 8684653..3b6bf3f 100644 --- a/src/bashi/results.py +++ b/src/bashi/results.py @@ -799,6 +799,11 @@ def _remove_all_rocm_images_non_ubuntu2004_based( parameter_value_pairs: List[ParameterValuePair], removed_parameter_value_pairs: List[ParameterValuePair], ): + """Remove all pairs where Ubuntu is older than 20.04 and the HIP backend is enabled or the host + or device compiler is HIPCC. + Args: + parameter_value_pairs (List[ParameterValuePair]): List of parameter-value pairs. + """ remove_parameter_value_pairs( parameter_value_pairs, removed_parameter_value_pairs, @@ -813,10 +818,10 @@ def _remove_all_rocm_images_non_ubuntu2004_based( remove_parameter_value_pairs( parameter_value_pairs, removed_parameter_value_pairs, - value_name1=UBUNTU, parameter1=UBUNTU, - value_version1=">=20.04", + value_name1=UBUNTU, parameter2=compiler_type, + value_version1=">=20.04", value_name2=HIPCC, value_version2=ANY_VERSION, ) diff --git a/tests/test_filter_software_dependency.py b/tests/test_filter_software_dependency.py index 927910d..097509d 100644 --- a/tests/test_filter_software_dependency.py +++ b/tests/test_filter_software_dependency.py @@ -214,6 +214,18 @@ def test_valid_ROCm_images_Ubuntu2004_based_d4(self): ), ), ) + self.assertTrue( + software_dependency_filter_typechecked( + OD( + { + HOST_COMPILER: ppv((HIPCC, 1)), + DEVICE_COMPILER: ppv((HIPCC, 1)), + ALPAKA_ACC_GPU_HIP_ENABLE: ppv((ALPAKA_ACC_GPU_HIP_ENABLE, OFF)), + UBUNTU: ppv((UBUNTU, "18.04")), + } + ), + ), + ) def test_non_valid_ROCm_images_Ubuntu2004_based_d4(self): for UBUNTU_version in ["16.04", "18.04", "19.04"]: diff --git a/tests/test_hipcc_filter.py b/tests/test_hipcc_filter.py index dd75316..5ccdf85 100644 --- a/tests/test_hipcc_filter.py +++ b/tests/test_hipcc_filter.py @@ -795,6 +795,18 @@ def test_hipcc_requires_ubuntu2004_pass_c19(self): ) ) ) + self.assertTrue( + compiler_filter_typechecked( + OD( + { + HOST_COMPILER: ppv((GCC, 1)), + DEVICE_COMPILER: ppv((GCC, 1)), + ALPAKA_ACC_GPU_HIP_ENABLE: ppv((ALPAKA_ACC_GPU_HIP_ENABLE, ON)), + UBUNTU: ppv((UBUNTU, "18.04")), + } + ), + ) + ) def test_hipcc_requires_ubuntu2004_not_pass_c19(self): for version in (4.5, 5.3, 6.0): @@ -811,7 +823,8 @@ def test_hipcc_requires_ubuntu2004_not_pass_c19(self): ) ) self.assertEqual( - reason_msg1.getvalue(), "hipcc does not support UBUNTU as compiler older than 20.04" + reason_msg1.getvalue(), + "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", ) reason_msg2 = io.StringIO() @@ -827,7 +840,8 @@ def test_hipcc_requires_ubuntu2004_not_pass_c19(self): ) ) self.assertEqual( - reason_msg2.getvalue(), "hipcc does not support UBUNTU as compiler older than 20.04" + reason_msg2.getvalue(), + "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", ) reason_msg3 = io.StringIO() @@ -844,7 +858,8 @@ def test_hipcc_requires_ubuntu2004_not_pass_c19(self): ) ) self.assertEqual( - reason_msg3.getvalue(), "hipcc does not support UBUNTU as compiler older than 20.04" + reason_msg3.getvalue(), + "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", ) reason_msg4 = io.StringIO() @@ -861,7 +876,8 @@ def test_hipcc_requires_ubuntu2004_not_pass_c19(self): ) ) self.assertEqual( - reason_msg4.getvalue(), "hipcc does not support UBUNTU as compiler older than 20.04" + reason_msg4.getvalue(), + "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", ) def test_hip_and_cuda_backend_cannot_be_active_at_the_same_time_b3(self):