Skip to content

Commit

Permalink
[SYCL][HIP] Fix hardcoded ROCm path in lit tests (#15239)
Browse files Browse the repository at this point in the history
This patch fixes running the interop HIP tests on setups where the ROCm
installation is not in `/opt/rocm`.
  • Loading branch information
npmiller authored Aug 30, 2024
1 parent 9fbf6b2 commit 95f9bc0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sycl/test-e2e/EnqueueNativeCommand/custom-command-hip.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// FIXME: the rocm include path and link path are highly platform dependent,
// we should set this with some variable instead.
// RUN: %{build} -o %t.out -I/opt/rocm/include -L/opt/rocm/lib -lamdhip64
// RUN: %{build} -o %t.out -I%rocm_path/include -L%rocm_path/lib -lamdhip64
// RUN: %{run} %t.out
// REQUIRES: hip

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/HostInteropTask/interop-task-hip.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// FIXME: the rocm include path and link path are highly platform dependent,
// we should set this with some variable instead.
// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out -I/opt/rocm/include -L/opt/rocm/lib -lamdhip64
// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out -I%rocm_path/include -L%rocm_path/lib -lamdhip64
// RUN: %{run} %t.out
// REQUIRES: hip

Expand Down
3 changes: 3 additions & 0 deletions sycl/test-e2e/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,9 @@ def open_check_file(file_name):
arch_flag = (
"-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=" + config.amd_arch
)
config.substitutions.append(
("%rocm_path", os.environ.get("ROCM_PATH", "/opt/rocm"))
)
elif "hip:gpu" in config.sycl_devices and config.hip_platform == "NVIDIA":
config.available_features.add("hip_nvidia")
arch_flag = ""
Expand Down

0 comments on commit 95f9bc0

Please sign in to comment.