From 386cf8b286082d6b11f1ef22b6d2a799e5ff4a07 Mon Sep 17 00:00:00 2001 From: "Le, Travis" Date: Fri, 29 May 2026 12:16:10 -0700 Subject: [PATCH 1/4] Added function to link libraries over Windows UNC network paths Applied function to OpenCl Library --- sycl/test-e2e/lit.cfg.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 565520251ae62..5ff09e9bd0179 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -277,6 +277,15 @@ def check_igc_tag_and_add_feature(): with open(config.igc_tag_file, "r") as tag_file: contents = tag_file.read() +def is_windows_unc_network_path(path): + if not path or platform.system() != "Windows": + return false + return path.startswith("//") or path.startswith(r"\\") + +def normalize_windows_network_path(path): + if is_windows_unc_network_path(path): + path = path.replace("/", r"\\") + return path def quote_path(path): if not path: @@ -557,12 +566,19 @@ def open_check_file(file_name): # Check for OpenCL ICD if config.opencl_libs_dir: + tmp_opencl_libs_dir = config.opencl_libs_dir config.opencl_libs_dir = quote_path(config.opencl_libs_dir) config.opencl_include_dir = quote_path(config.opencl_include_dir) if cl_options: - config.substitutions.append( - ("%opencl_lib", " " + config.opencl_libs_dir + "/OpenCL.lib") - ) + if is_windows_unc_network_path(tmp_opencl_libs_dir): + tmp_opencl_libs_dir = quote_path(normalize_windows_network_path(tmp_opencl_libs_dir) + "\\\\OpenCL.lib") + config.substitutions.append( + ("%opencl_lib", " " + tmp_opencl_libs_dir) + ) + else: + config.substitutions.append( + ("%opencl_lib", " " + config.opencl_libs_dir + "/OpenCL.lib") + ) else: config.substitutions.append( ("%opencl_lib", "-L" + config.opencl_libs_dir + " -lOpenCL") From 8a8c9d1ff4c7d99f77a37238bfde035fa8fdcdb7 Mon Sep 17 00:00:00 2001 From: "Le, Travis" Date: Fri, 29 May 2026 15:08:01 -0700 Subject: [PATCH 2/4] Re-formated Python Code --- sycl/test-e2e/lit.cfg.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 5ff09e9bd0179..8aa94f505e841 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -566,19 +566,15 @@ def open_check_file(file_name): # Check for OpenCL ICD if config.opencl_libs_dir: - tmp_opencl_libs_dir = config.opencl_libs_dir + opencl_lib = config.opencl_libs_dir + "/OpenCL.lib" config.opencl_libs_dir = quote_path(config.opencl_libs_dir) config.opencl_include_dir = quote_path(config.opencl_include_dir) if cl_options: - if is_windows_unc_network_path(tmp_opencl_libs_dir): - tmp_opencl_libs_dir = quote_path(normalize_windows_network_path(tmp_opencl_libs_dir) + "\\\\OpenCL.lib") - config.substitutions.append( - ("%opencl_lib", " " + tmp_opencl_libs_dir) - ) - else: - config.substitutions.append( - ("%opencl_lib", " " + config.opencl_libs_dir + "/OpenCL.lib") - ) + if is_windows_unc_network_path(opencl_lib): + opencl_lib = normalize_windows_network_path(opencl_lib) + config.substitutions.append( + ("%opencl_lib", " " + quote_path(opencl_lib)) + ) else: config.substitutions.append( ("%opencl_lib", "-L" + config.opencl_libs_dir + " -lOpenCL") From 62d4259364c54b712c9398fe30e561caeb4d1f5d Mon Sep 17 00:00:00 2001 From: "Le, Travis" Date: Mon, 1 Jun 2026 10:53:23 -0700 Subject: [PATCH 3/4] Fixing format --- sycl/test-e2e/lit.cfg.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 8aa94f505e841..adc5eb98e3e73 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -277,16 +277,19 @@ def check_igc_tag_and_add_feature(): with open(config.igc_tag_file, "r") as tag_file: contents = tag_file.read() + def is_windows_unc_network_path(path): if not path or platform.system() != "Windows": return false return path.startswith("//") or path.startswith(r"\\") + def normalize_windows_network_path(path): if is_windows_unc_network_path(path): path = path.replace("/", r"\\") return path + def quote_path(path): if not path: return "" @@ -566,15 +569,13 @@ def open_check_file(file_name): # Check for OpenCL ICD if config.opencl_libs_dir: - opencl_lib = config.opencl_libs_dir + "/OpenCL.lib" + opencl_lib = config.opencl_libs_dir + "/OpenCL.lib" config.opencl_libs_dir = quote_path(config.opencl_libs_dir) config.opencl_include_dir = quote_path(config.opencl_include_dir) if cl_options: if is_windows_unc_network_path(opencl_lib): opencl_lib = normalize_windows_network_path(opencl_lib) - config.substitutions.append( - ("%opencl_lib", " " + quote_path(opencl_lib)) - ) + config.substitutions.append(("%opencl_lib", " " + quote_path(opencl_lib))) else: config.substitutions.append( ("%opencl_lib", "-L" + config.opencl_libs_dir + " -lOpenCL") From 2b9e391c77f3425e0f68a5a8231f46cf15a5d9a7 Mon Sep 17 00:00:00 2001 From: "Le, Travis" Date: Mon, 1 Jun 2026 11:24:07 -0700 Subject: [PATCH 4/4] Minor format change --- sycl/test-e2e/lit.cfg.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index adc5eb98e3e73..d6269520501fb 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -577,9 +577,7 @@ def open_check_file(file_name): opencl_lib = normalize_windows_network_path(opencl_lib) config.substitutions.append(("%opencl_lib", " " + quote_path(opencl_lib))) else: - config.substitutions.append( - ("%opencl_lib", "-L" + config.opencl_libs_dir + " -lOpenCL") - ) + config.substitutions.append(("%opencl_lib", "-L" + config.opencl_libs_dir + " -lOpenCL")) config.available_features.add("opencl_icd") config.substitutions.append(("%opencl_include_dir", config.opencl_include_dir))