Skip to content

Commit b38eb60

Browse files
authored
[SYCL][E2E] Fix CUDA/HIP options on Windows (#17985)
We need to set `cuda-path`/`hip-path` on Windows as the autodetection isn't implemented upstream, it seems only implemented for Linux. Also fix a double assign and a missed update in `E2EExpr` This was tested with some other pending changes [here](https://github.com/intel/llvm/actions/runs/14389689524/job/40353640119?pr=14114) and [here](https://github.com/intel/llvm/actions/runs/14389689487/job/40353627543?pr=14114). Signed-off-by: Sarnie, Nick <[email protected]>
1 parent 3758172 commit b38eb60

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Diff for: sycl/test-e2e/E2EExpr.py

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class E2EExpr(BooleanExpression):
3434
"hip_dev_kit",
3535
"zstd",
3636
"vulkan",
37+
"hip_options",
38+
"cuda_options",
3739
"true",
3840
"false",
3941
}

Diff for: sycl/test-e2e/lit.cfg.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def open_check_file(file_name):
434434
)
435435
)
436436

437-
cuda_options = cuda_options = (
437+
cuda_options = (
438438
(" -L" + config.cuda_libs_dir if config.cuda_libs_dir else "")
439439
+ " -lcuda "
440440
+ " -I"
@@ -447,6 +447,10 @@ def open_check_file(file_name):
447447
+ " /I"
448448
+ config.cuda_include
449449
)
450+
if platform.system() == "Windows":
451+
cuda_options += (
452+
" --cuda-path=" + os.path.dirname(os.path.dirname(config.cuda_libs_dir)) + f'"'
453+
)
450454

451455
config.substitutions.append(("%cuda_options", cuda_options))
452456

@@ -483,7 +487,7 @@ def open_check_file(file_name):
483487
)
484488
)
485489

486-
hip_options = hip_options = (
490+
hip_options = (
487491
(" -L" + config.hip_libs_dir if config.hip_libs_dir else "")
488492
+ " -lamdhip64 "
489493
+ " -I"
@@ -500,7 +504,8 @@ def open_check_file(file_name):
500504
+ " /I"
501505
+ config.hip_include
502506
)
503-
507+
if platform.system() == "Windows":
508+
hip_options += " --rocm-path=" + os.path.dirname(config.hip_libs_dir) + f'"'
504509
with test_env():
505510
sp = subprocess.getstatusoutput(
506511
config.dpcpp_compiler + " -fsycl " + check_hip_file + hip_options

0 commit comments

Comments
 (0)