Skip to content

Commit 6388b3f

Browse files
authored
[SYCL][E2E] Fix lit ROCM_PATH setup for build-only (#17298)
`ROCM_PATH` and the `%rocm_path` substitutions need to be set for compilation. The `FIXME` in these tests dates from where the ROCm path was hardcoded, it should've been removed when the substitutions were introduced, so removing it now. Fixes: #17018
1 parent 255760e commit 6388b3f

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
// FIXME: the rocm include path and link path are highly platform dependent,
2-
// we should set this with some variable instead.
3-
// https://github.com/intel/llvm/issues/17018
4-
5-
// RUN: %{run-aux} %{build} -Wno-error=deprecated-pragma -o %t.out -I%rocm_path/include -L%rocm_path/lib -lamdhip64
1+
// RUN: %{build} -Wno-error=deprecated-pragma -o %t.out -I%rocm_path/include -L%rocm_path/lib -lamdhip64
62
// RUN: %{run} %t.out
73
// REQUIRES: target-amd
84

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
// FIXME: the rocm include path and link path are highly platform dependent,
2-
// we should set this with some variable instead.
3-
// https://github.com/intel/llvm/issues/17018
4-
5-
// RUN: %{run-aux} %{build} -Wno-error=deprecated-pragma -Wno-error=deprecated-declarations -o %t.out -I%rocm_path/include -L%rocm_path/lib -lamdhip64
1+
// RUN: %{build} -Wno-error=deprecated-pragma -Wno-error=deprecated-declarations -o %t.out -I%rocm_path/include -L%rocm_path/lib -lamdhip64
62
// RUN: %{run} %t.out
73
// REQUIRES: target-amd
84

sycl/test-e2e/lit.cfg.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,13 @@ def open_check_file(file_name):
577577
if be not in available_devices or dev not in available_devices[be]:
578578
lit_config.error("Unsupported device {}".format(d))
579579

580+
# Set ROCM_PATH to help clang find the HIP installation.
581+
if "target-amd" in config.sycl_build_targets:
582+
llvm_config.with_system_environment("ROCM_PATH")
583+
config.substitutions.append(
584+
("%rocm_path", os.environ.get("ROCM_PATH", "/opt/rocm"))
585+
)
586+
580587
if "cuda:gpu" in config.sycl_devices:
581588
if "CUDA_PATH" not in os.environ:
582589
if platform.system() == "Windows":
@@ -898,10 +905,6 @@ def open_check_file(file_name):
898905
"Cannot detect architecture for AMD HIP device, specify it explicitly"
899906
)
900907
config.amd_arch = arch.replace(amd_arch_prefix, "")
901-
llvm_config.with_system_environment("ROCM_PATH")
902-
config.substitutions.append(
903-
("%rocm_path", os.environ.get("ROCM_PATH", "/opt/rocm"))
904-
)
905908

906909
config.sycl_dev_features[sycl_device] = features.union(config.available_features)
907910
if is_intel_driver:

0 commit comments

Comments
 (0)