Skip to content

Commit

Permalink
update hipblas rocalution, rocsolver, rocsparse to new syntax (spack#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
afzpatel authored Nov 28, 2023
1 parent 1ebd37d commit 92e0d42
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 15 deletions.
11 changes: 7 additions & 4 deletions var/spack/repos/builtin/packages/hipblas/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("[email protected]:", type="build", when="@5.2.0:")
depends_on("[email protected]:", type="build", when="@4.5.0:")
Expand Down Expand Up @@ -222,3 +219,9 @@ def cmake_args(self):
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*")
Original file line number Diff line number Diff line change
@@ -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
-)
10 changes: 6 additions & 4 deletions var/spack/repos/builtin/packages/rocalution/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -236,3 +232,9 @@ def cmake_args(self):
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()
11 changes: 7 additions & 4 deletions var/spack/repos/builtin/packages/rocsolver/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class Rocsolver(CMakePackage):
depends_on("[email protected]:", type="build", when="@4.1.0:")
depends_on("[email protected]:", 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("[email protected]:", type="test")
depends_on("[email protected]:", type="test")
Expand All @@ -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("[email protected]:", when="@4.1.0:")
depends_on("rocm-cmake@master", type="build", when="@master:")
depends_on("[email protected]:", type="build", when="@4.5.0:")
Expand Down Expand Up @@ -236,3 +233,9 @@ def cmake_args(self):

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*")
9 changes: 6 additions & 3 deletions var/spack/repos/builtin/packages/rocsparse/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 92e0d42

Please sign in to comment.