diff --git a/src/bashi/filter_compiler.py b/src/bashi/filter_compiler.py index b082487..79a6b0e 100644 --- a/src/bashi/filter_compiler.py +++ b/src/bashi/filter_compiler.py @@ -204,7 +204,7 @@ def compiler_filter( if UBUNTU in row and row[UBUNTU].version < pkv.parse("20.04"): reason( output, - "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", + "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", ) return False diff --git a/src/bashi/filter_software_dependency.py b/src/bashi/filter_software_dependency.py index d816345..bd2bbbc 100644 --- a/src/bashi/filter_software_dependency.py +++ b/src/bashi/filter_software_dependency.py @@ -111,9 +111,9 @@ def software_dependency_filter( if ALPAKA_ACC_GPU_HIP_ENABLE in row and row[ALPAKA_ACC_GPU_HIP_ENABLE].version != OFF_VER: reason( output, - f"ROCm images " - "is not available in UBUNTU " - f"{__ubuntu_version_to_string(row[UBUNTU].version)}", + "ROCm and also the hipcc compiler " + "is not available on Ubuntu " + "older than 20.04", ) return False return True diff --git a/tests/test_filter_software_dependency.py b/tests/test_filter_software_dependency.py index 097509d..20419f1 100644 --- a/tests/test_filter_software_dependency.py +++ b/tests/test_filter_software_dependency.py @@ -240,9 +240,65 @@ def test_non_valid_ROCm_images_Ubuntu2004_based_d4(self): ), reason_msg, ), - f"ROCm images is not available in UBUNTU {UBUNTU_version}", + f"ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", ) self.assertEqual( reason_msg.getvalue(), - f"ROCm images is not available in UBUNTU {UBUNTU_version}", + f"ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", + ) + + for host_name, device_name, hip_backend, ubuntu_version, error_msg in [ + ( + HIPCC, + HIPCC, + ON, + "18.04", + "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", + ), + ( + HIPCC, + GCC, + ON, + "18.04", + "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", + ), + ( + CLANG, + HIPCC, + ON, + "18.04", + "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", + ), + ( + GCC, + HIPCC, + ON, + "18.04", + "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", + ), + ( + HIPCC, + CLANG, + ON, + "18.04", + "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", + ), + ]: + test_row = OD( + { + HOST_COMPILER: ppv((host_name, 1)), + DEVICE_COMPILER: ppv((device_name, 1)), + ALPAKA_ACC_GPU_HIP_ENABLE: ppv((ALPAKA_ACC_GPU_HIP_ENABLE, hip_backend)), + UBUNTU: ppv((UBUNTU, ubuntu_version)), + }, + ) + reason_msg = io.StringIO() + self.assertFalse( + software_dependency_filter_typechecked(test_row, reason_msg), + f"{test_row}", + ) + self.assertEqual( + reason_msg.getvalue(), + error_msg, + f"{test_row}", ) diff --git a/tests/test_hipcc_filter.py b/tests/test_hipcc_filter.py index 5ccdf85..f262ae9 100644 --- a/tests/test_hipcc_filter.py +++ b/tests/test_hipcc_filter.py @@ -824,7 +824,7 @@ def test_hipcc_requires_ubuntu2004_not_pass_c19(self): ) self.assertEqual( reason_msg1.getvalue(), - "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", + "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", ) reason_msg2 = io.StringIO() @@ -841,7 +841,7 @@ def test_hipcc_requires_ubuntu2004_not_pass_c19(self): ) self.assertEqual( reason_msg2.getvalue(), - "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", + "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", ) reason_msg3 = io.StringIO() @@ -859,7 +859,7 @@ def test_hipcc_requires_ubuntu2004_not_pass_c19(self): ) self.assertEqual( reason_msg3.getvalue(), - "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", + "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", ) reason_msg4 = io.StringIO() @@ -877,7 +877,62 @@ def test_hipcc_requires_ubuntu2004_not_pass_c19(self): ) self.assertEqual( reason_msg4.getvalue(), - "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", + "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", + ) + for host_name, device_name, hip_backend, ubuntu_version, error_msg in [ + ( + HIPCC, + HIPCC, + ON, + "18.04", + "ROCm and also the hipcc compiler is not available on Ubuntu older than 20.04", + ), + ( + HIPCC, + GCC, + ON, + "18.04", + "host and device compiler name must be the same (except for nvcc)", + ), + ( + CLANG, + HIPCC, + ON, + "18.04", + "host and device compiler name must be the same (except for nvcc)", + ), + ( + GCC, + HIPCC, + OFF, + "18.04", + "host and device compiler name must be the same (except for nvcc)", + ), + ( + HIPCC, + CLANG, + OFF, + "18.04", + "host and device compiler name must be the same (except for nvcc)", + ), + ]: + test_row = OD( + { + HOST_COMPILER: ppv((host_name, 1)), + DEVICE_COMPILER: ppv((device_name, 1)), + ALPAKA_ACC_GPU_HIP_ENABLE: ppv((ALPAKA_ACC_GPU_HIP_ENABLE, hip_backend)), + UBUNTU: ppv((UBUNTU, ubuntu_version)), + }, + ) + reason_msg = io.StringIO() + self.assertFalse( + compiler_filter_typechecked(test_row, reason_msg), + f"{test_row}", + ) + self.assertEqual( + reason_msg.getvalue(), + error_msg, + f"{test_row}", ) def test_hip_and_cuda_backend_cannot_be_active_at_the_same_time_b3(self):