Skip to content

Commit 95f9bc0

Browse files
authored
[SYCL][HIP] Fix hardcoded ROCm path in lit tests (#15239)
This patch fixes running the interop HIP tests on setups where the ROCm installation is not in `/opt/rocm`.
1 parent 9fbf6b2 commit 95f9bc0

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

sycl/test-e2e/EnqueueNativeCommand/custom-command-hip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// FIXME: the rocm include path and link path are highly platform dependent,
22
// we should set this with some variable instead.
3-
// RUN: %{build} -o %t.out -I/opt/rocm/include -L/opt/rocm/lib -lamdhip64
3+
// RUN: %{build} -o %t.out -I%rocm_path/include -L%rocm_path/lib -lamdhip64
44
// RUN: %{run} %t.out
55
// REQUIRES: hip
66

sycl/test-e2e/HostInteropTask/interop-task-hip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// FIXME: the rocm include path and link path are highly platform dependent,
22
// we should set this with some variable instead.
3-
// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out -I/opt/rocm/include -L/opt/rocm/lib -lamdhip64
3+
// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out -I%rocm_path/include -L%rocm_path/lib -lamdhip64
44
// RUN: %{run} %t.out
55
// REQUIRES: hip
66

sycl/test-e2e/lit.cfg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,9 @@ def open_check_file(file_name):
566566
arch_flag = (
567567
"-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=" + config.amd_arch
568568
)
569+
config.substitutions.append(
570+
("%rocm_path", os.environ.get("ROCM_PATH", "/opt/rocm"))
571+
)
569572
elif "hip:gpu" in config.sycl_devices and config.hip_platform == "NVIDIA":
570573
config.available_features.add("hip_nvidia")
571574
arch_flag = ""

0 commit comments

Comments
 (0)