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>
This commit is contained in:
parent
31ef1df74f
commit
2029d714a0
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
@ -167,13 +168,15 @@ def post_install(self):
|
|||||||
with open(join_path(vendor_config_path, config_file_name), "w") as f:
|
with open(join_path(vendor_config_path, config_file_name), "w") as f:
|
||||||
f.write("libamdocl64.so")
|
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):
|
os.environ["LD_LIBRARY_PATH"] += os.pathsep + join_path(self.prefix, test_dir)
|
||||||
test_dir = join_path(self.spec["rocm-opencl"].prefix, self.test_src_dir)
|
|
||||||
with working_dir(test_dir, create=True):
|
ocltst = which(join_path(self.prefix, test_dir, "ocltst"))
|
||||||
os.environ["LD_LIBRARY_PATH"] += os.pathsep + test_dir
|
with test_part(self, "test_ocltst_runtime", purpose="check runtime"):
|
||||||
args = ["-m", "liboclruntime.so", "-A", "oclruntime.exclude"]
|
ocltst("-m", "liboclruntime.so", "-A", "oclruntime.exclude")
|
||||||
self.run_test("ocltst", args)
|
|
||||||
args = ["-m", "liboclperf.so", "-A", "oclperf.exclude"]
|
with test_part(self, "test_ocltst_perf", purpose="check perf"):
|
||||||
self.run_test("ocltst", args)
|
ocltst("-m", "liboclperf.so", "-A", "oclperf.exclude")
|
||||||
|
Loading…
Reference in New Issue
Block a user