@@ -36,6 +36,20 @@ def prepare_windows_opencl_runtime() -> None:
3636 )
3737
3838
39+ def run_command (command : list [str ], env : dict [str , str ]) -> int :
40+ print ("+" , " " .join (command ), flush = True )
41+ return subprocess .run (command , check = False , env = env ).returncode
42+
43+
44+ def run_windows_sycl_diagnostics (env : dict [str , str ]) -> None :
45+ sycl_ls = find_file ([Path ("build" ).resolve (), Path (env .get ("SYCL_ROOT" , "" ))], "sycl-ls.exe" )
46+ if sycl_ls is None :
47+ return
48+
49+ for arguments in ([str (sycl_ls )], [str (sycl_ls ), "--verbose" ]):
50+ run_command (arguments , env )
51+
52+
3953def main () -> int :
4054 prepare_windows_opencl_runtime ()
4155
@@ -45,9 +59,34 @@ def main() -> int:
4559 if device_selector :
4660 env ["ONEAPI_DEVICE_SELECTOR" ] = device_selector
4761
62+ if os .environ .get ("RUNNER_OS" ) == "Windows" :
63+ run_windows_sycl_diagnostics (env )
64+
65+ example_command = [
66+ "ctest" ,
67+ "--test-dir" ,
68+ "build" ,
69+ "--output-on-failure" ,
70+ "-R" ,
71+ "^SYCL\\ .Example$" ,
72+ ]
73+ example_result = run_command (example_command , env )
74+ if example_result != 0 :
75+ return example_result
76+
77+ remaining_command = [
78+ "ctest" ,
79+ "--test-dir" ,
80+ "build" ,
81+ "--output-on-failure" ,
82+ "-E" ,
83+ "^SYCL\\ .Example$" ,
84+ "--parallel" ,
85+ ]
86+ return run_command (remaining_command , env )
87+
4888 command = ["ctest" , "--test-dir" , "build" , "--output-on-failure" , "--parallel" ]
49- print ("+" , " " .join (command ), flush = True )
50- return subprocess .run (command , check = False , env = env ).returncode
89+ return run_command (command , env )
5190
5291
5392if __name__ == "__main__" :
0 commit comments