From 4de9a64fbeb543123ed628fb2a31695fca05750c Mon Sep 17 00:00:00 2001 From: Nicolas Miller Date: Wed, 14 May 2025 15:46:52 +0100 Subject: [PATCH 1/3] [SYCL][E2E] Use `ROCM_PATH` from the system environment For ROCm installations that aren't just in `/opt/rocm`, `clang` uses `ROCM_PATH` at runtime to find the ROCm device libraries, and this is done even in regular SYCL compilation. So this is needed for lit tests in certain configurations. --- sycl/test-e2e/lit.cfg.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 65307be2bb641..10aa2bc257cf8 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -541,6 +541,10 @@ def open_check_file(file_name): else: config.substitutions.append(("%hip_options", "")) +# Add ROCM_PATH from system environment, this is used by clang to find ROCm +# libraries in non-standard installation locations. +llvm_config.with_system_environment("ROCM_PATH") + # Check for OpenCL ICD if config.opencl_libs_dir: config.opencl_libs_dir = quote_path(config.opencl_libs_dir) From 7b2ac01092c3bb500afad63e52719c6bc48673d3 Mon Sep 17 00:00:00 2001 From: Nicolas Miller Date: Wed, 14 May 2025 18:01:38 +0100 Subject: [PATCH 2/3] [SYCL][E2E] Remove --rocm-path on Windows This may be covered by ROCM_PATH --- sycl/test-e2e/lit.cfg.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 10aa2bc257cf8..03df494e5b775 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -529,8 +529,6 @@ def open_check_file(file_name): + " /I" + config.hip_include ) -if platform.system() == "Windows": - hip_options += " --rocm-path=" + os.path.dirname(config.hip_libs_dir) + f'"' with test_env(): sp = subprocess.getstatusoutput( config.dpcpp_compiler + " -fsycl " + check_hip_file + hip_options From 284af557b3cfb2a7cd07e6c948bbc28e919a1226 Mon Sep 17 00:00:00 2001 From: Nicolas Miller Date: Wed, 14 May 2025 20:02:18 +0100 Subject: [PATCH 3/3] Revert "[SYCL][E2E] Remove --rocm-path on Windows" This reverts commit 7b2ac01092c3bb500afad63e52719c6bc48673d3. --- sycl/test-e2e/lit.cfg.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 03df494e5b775..10aa2bc257cf8 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -529,6 +529,8 @@ def open_check_file(file_name): + " /I" + config.hip_include ) +if platform.system() == "Windows": + hip_options += " --rocm-path=" + os.path.dirname(config.hip_libs_dir) + f'"' with test_env(): sp = subprocess.getstatusoutput( config.dpcpp_compiler + " -fsycl " + check_hip_file + hip_options