diff options
author | AcriusWinter <152348900+AcriusWinter@users.noreply.github.com> | 2024-07-18 09:35:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-18 09:35:10 -0700 |
commit | 2029d714a0322b120189e0f7ca75d47f2cda4b4f (patch) | |
tree | 6cc4bf3125abf3a57f9640ce1b2a55e13289fd22 | |
parent | 31ef1df74fbce35283b36ec282bf8ddf6227fc12 (diff) | |
download | spack-2029d714a0322b120189e0f7ca75d47f2cda4b4f.tar.gz spack-2029d714a0322b120189e0f7ca75d47f2cda4b4f.tar.bz2 spack-2029d714a0322b120189e0f7ca75d47f2cda4b4f.tar.xz spack-2029d714a0322b120189e0f7ca75d47f2cda4b4f.zip |
rocm-opencl: old to new test API (#45065)
* rocm-opencl: old to new test API
* Run tests from test stage directory
---------
Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
-rw-r--r-- | var/spack/repos/builtin/packages/rocm-opencl/package.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/var/spack/repos/builtin/packages/rocm-opencl/package.py b/var/spack/repos/builtin/packages/rocm-opencl/package.py index cfc34d1a37..ea6e3779bf 100644 --- a/var/spack/repos/builtin/packages/rocm-opencl/package.py +++ b/var/spack/repos/builtin/packages/rocm-opencl/package.py @@ -5,6 +5,7 @@ import os import re +import sys from spack.package import * @@ -167,13 +168,15 @@ class RocmOpencl(CMakePackage): with open(join_path(vendor_config_path, config_file_name), "w") as f: f.write("libamdocl64.so") - test_src_dir = "tests/ocltst" + def test_ocltst(self): + """Run ocltst checks""" + test_dir = "tests/ocltst" if sys.platform == "win32" else "share/opencl/ocltst" - def test(self): - test_dir = join_path(self.spec["rocm-opencl"].prefix, self.test_src_dir) - with working_dir(test_dir, create=True): - os.environ["LD_LIBRARY_PATH"] += os.pathsep + test_dir - args = ["-m", "liboclruntime.so", "-A", "oclruntime.exclude"] - self.run_test("ocltst", args) - args = ["-m", "liboclperf.so", "-A", "oclperf.exclude"] - self.run_test("ocltst", args) + os.environ["LD_LIBRARY_PATH"] += os.pathsep + join_path(self.prefix, test_dir) + + ocltst = which(join_path(self.prefix, test_dir, "ocltst")) + with test_part(self, "test_ocltst_runtime", purpose="check runtime"): + ocltst("-m", "liboclruntime.so", "-A", "oclruntime.exclude") + + with test_part(self, "test_ocltst_perf", purpose="check perf"): + ocltst("-m", "liboclperf.so", "-A", "oclperf.exclude") |