From 92e0d42b6459265db546353cca803ce4f41afac1 Mon Sep 17 00:00:00 2001 From: afzpatel <122491982+afzpatel@users.noreply.github.com> Date: Tue, 28 Nov 2023 15:49:07 -0500 Subject: update hipblas rocalution, rocsolver, rocsparse to new syntax (#40135) * initial commit to update hipblas rocalution, rocsolver, rocsparse to new syntax * add rocblas test changes and fixes for hipblas and rocsolver tests * fix styling * remove updates for rocblas --- var/spack/repos/builtin/packages/hipblas/package.py | 11 +++++++---- .../remove-hipblas-clients-file-installation.patch | 18 ++++++++++++++++++ var/spack/repos/builtin/packages/rocalution/package.py | 10 ++++++---- var/spack/repos/builtin/packages/rocsolver/package.py | 11 +++++++---- var/spack/repos/builtin/packages/rocsparse/package.py | 9 ++++++--- 5 files changed, 44 insertions(+), 15 deletions(-) create mode 100644 var/spack/repos/builtin/packages/hipblas/remove-hipblas-clients-file-installation.patch diff --git a/var/spack/repos/builtin/packages/hipblas/package.py b/var/spack/repos/builtin/packages/hipblas/package.py index b0261bd5db..973a8c34b3 100644 --- a/var/spack/repos/builtin/packages/hipblas/package.py +++ b/var/spack/repos/builtin/packages/hipblas/package.py @@ -132,10 +132,7 @@ class Hipblas(CMakePackage, CudaPackage, ROCmPackage): patch("link-clients-blas.patch", when="@4.3.0:4.3.2") patch("link-clients-blas-4.5.0.patch", when="@4.5.0:4.5.2") patch("hipblas-link-clients-blas-5.0.0.patch", when="@5.0.0:5.0.2") - - def check(self): - exe = join_path(self.build_directory, "clients", "staging", "hipblas-test") - self.run_test(exe, options=["--gtest_filter=-*known_bug*"]) + patch("remove-hipblas-clients-file-installation.patch", when="@5.5:") depends_on("rocm-cmake@5.2.0:", type="build", when="@5.2.0:") depends_on("rocm-cmake@4.5.0:", type="build", when="@4.5.0:") @@ -222,3 +219,9 @@ class Hipblas(CMakePackage, CudaPackage, ROCmPackage): args.append("-DCMAKE_INSTALL_LIBDIR=lib") return args + + @run_after("build") + @on_package_attributes(run_tests=True) + def check_build(self): + exe = Executable(join_path(self.build_directory, "clients", "staging", "hipblas-test")) + exe("--gtest_filter=-*known_bug*") diff --git a/var/spack/repos/builtin/packages/hipblas/remove-hipblas-clients-file-installation.patch b/var/spack/repos/builtin/packages/hipblas/remove-hipblas-clients-file-installation.patch new file mode 100644 index 0000000000..a1adf89306 --- /dev/null +++ b/var/spack/repos/builtin/packages/hipblas/remove-hipblas-clients-file-installation.patch @@ -0,0 +1,18 @@ +diff --git a/clients/CMakeLists.txt b/clients/CMakeLists.txt +index 2ae1535..c956e00 100644 +--- a/clients/CMakeLists.txt ++++ b/clients/CMakeLists.txt +@@ -134,13 +134,3 @@ add_custom_command( OUTPUT "${HIPBLAS_GENTEST}" + + add_custom_target( hipblas-common DEPENDS "${HIPBLAS_COMMON}" "${HIPBLAS_TEMPLATE}" "${HIPBLAS_SMOKE}" "${HIPBLAS_GENTEST}" ) + +-rocm_install( +- FILES ${HIPBLAS_COMMON} ${HIPBLAS_TEMPLATE} ${HIPBLAS_SMOKE} +- DESTINATION "${CMAKE_INSTALL_BINDIR}" +- COMPONENT clients-common +-) +-rocm_install( +- PROGRAMS ${HIPBLAS_GENTEST} +- DESTINATION "${CMAKE_INSTALL_BINDIR}" +- COMPONENT clients-common +-) diff --git a/var/spack/repos/builtin/packages/rocalution/package.py b/var/spack/repos/builtin/packages/rocalution/package.py index b0ba2021ba..4b80d75ee7 100644 --- a/var/spack/repos/builtin/packages/rocalution/package.py +++ b/var/spack/repos/builtin/packages/rocalution/package.py @@ -184,10 +184,6 @@ class Rocalution(CMakePackage): # Fix build for most Radeon 5000 and Radeon 6000 series GPUs. patch("0004-fix-navi-1x.patch", when="@5.2.0:5.3") - def check(self): - exe = join_path(self.build_directory, "clients", "staging", "rocalution-test") - self.run_test(exe) - def setup_build_environment(self, env): env.set("CXX", self.spec["hip"].hipcc) @@ -236,3 +232,9 @@ class Rocalution(CMakePackage): args.append("-DCMAKE_INSTALL_LIBDIR=lib") return args + + @run_after("build") + @on_package_attributes(run_tests=True) + def check_build(self): + exe = Executable(join_path(self.build_directory, "clients", "staging", "rocalution-test")) + exe() diff --git a/var/spack/repos/builtin/packages/rocsolver/package.py b/var/spack/repos/builtin/packages/rocsolver/package.py index 3b1cfcb511..babf8b9d52 100644 --- a/var/spack/repos/builtin/packages/rocsolver/package.py +++ b/var/spack/repos/builtin/packages/rocsolver/package.py @@ -126,6 +126,7 @@ class Rocsolver(CMakePackage): depends_on("cmake@3.8:", type="build", when="@4.1.0:") depends_on("cmake@3.5:", type="build") depends_on("fmt@7:", type="build", when="@4.5.0:") + depends_on("fmt@7:8.0.1", type="test", when="@5.6:") depends_on("googletest@1.10.0:", type="test") depends_on("netlib-lapack@3.7.1:", type="test") @@ -136,10 +137,6 @@ class Rocsolver(CMakePackage): # Maximize compatibility with other libraries that are using fmt. patch("fmt-9-compatibility.patch", when="@5.2.0:5.5") - def check(self): - exe = join_path(self.build_directory, "clients", "staging", "rocsolver-test") - self.run_test(exe, options=["--gtest_filter=checkin*-*known_bug*"]) - depends_on("hip@4.1.0:", when="@4.1.0:") depends_on("rocm-cmake@master", type="build", when="@master:") depends_on("rocm-cmake@4.5.0:", type="build", when="@4.5.0:") @@ -236,3 +233,9 @@ class Rocsolver(CMakePackage): def setup_build_environment(self, env): env.set("CXX", self.spec["hip"].hipcc) + + @run_after("build") + @on_package_attributes(run_tests=True) + def check_build(self): + exe = Executable(join_path(self.build_directory, "clients", "staging", "rocsolver-test")) + exe("--gtest_filter=checkin*-*known_bug*") diff --git a/var/spack/repos/builtin/packages/rocsparse/package.py b/var/spack/repos/builtin/packages/rocsparse/package.py index 4fb8fb1646..e0ae280662 100644 --- a/var/spack/repos/builtin/packages/rocsparse/package.py +++ b/var/spack/repos/builtin/packages/rocsparse/package.py @@ -311,10 +311,13 @@ class Rocsparse(CMakePackage): destination="mtx", ) - def check(self): + @run_after("build") + def check_build(self): if self.spec.satisfies("+test"): - exe = join_path(self.build_directory, "clients", "staging", "rocsparse-test") - self.run_test(exe, options=["--gtest_filter=*quick*:*pre_checkin*-*known_bug*"]) + exe = Executable( + join_path(self.build_directory, "clients", "staging", "rocsparse-test") + ) + exe("--gtest_filter=*quick*:*pre_checkin*-*known_bug*") def setup_build_environment(self, env): env.set("CXX", self.spec["hip"].hipcc) -- cgit v1.2.3-70-g09d2