Skip to content

Commit 6e63a2c

Browse files
authored
[SYCL][E2E] Fix error reporting in e2e lit config (#18535)
Checking the output of `get_sycl_ls_verbose` expected the function to update a global `sp` variable. Since it didn't do that, this resulted in an error when trying to print the command output. This patch changes the function to return the subprocess directly, which is used during error message generation.
1 parent 7540f3d commit 6e63a2c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

sycl/test-e2e/lit.cfg.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ def get_sycl_ls_verbose(sycl_device, env):
864864
f"stdout:{sp.stdout}\n"
865865
f"stderr:{sp.stderr}\n"
866866
)
867-
return sp.stdout.splitlines()
867+
return sp
868868

869869

870870
# A device filter such as level_zero:gpu can have multiple devices under it and
@@ -893,7 +893,7 @@ def get_sycl_ls_verbose(sycl_device, env):
893893

894894
platform_devices = remove_level_zero_suffix(backend + ":*")
895895

896-
for line in get_sycl_ls_verbose(platform_devices, env):
896+
for line in get_sycl_ls_verbose(platform_devices, env).stdout.splitlines():
897897
if re.match(r" *Architecture:", line):
898898
_, architecture = line.strip().split(":", 1)
899899
detected_architectures.append(architecture.strip())
@@ -952,7 +952,8 @@ def get_sycl_ls_verbose(sycl_device, env):
952952
# See format.py's parse_min_intel_driver_req for explanation.
953953
is_intel_driver = False
954954
intel_driver_ver = {}
955-
for line in get_sycl_ls_verbose(sycl_device, env):
955+
sycl_ls_sp = get_sycl_ls_verbose(sycl_device, env)
956+
for line in sycl_ls_sp.stdout.splitlines():
956957
if re.match(r" *Vendor *: Intel\(R\) Corporation", line):
957958
is_intel_driver = True
958959
if re.match(r" *Driver *:", line):
@@ -989,7 +990,7 @@ def get_sycl_ls_verbose(sycl_device, env):
989990
if dev_aspects == []:
990991
lit_config.error(
991992
"Cannot detect device aspect for {}\nstdout:\n{}\nstderr:\n{}".format(
992-
sycl_device, sp.stdout, sp.stderr
993+
sycl_device, sycl_ls_sp.stdout, sycl_ls_sp.stderr
993994
)
994995
)
995996
dev_aspects.append(set())
@@ -1001,7 +1002,7 @@ def get_sycl_ls_verbose(sycl_device, env):
10011002
if dev_sg_sizes == []:
10021003
lit_config.error(
10031004
"Cannot detect device SG sizes for {}\nstdout:\n{}\nstderr:\n{}".format(
1004-
sycl_device, sp.stdout, sp.stderr
1005+
sycl_device, sycl_ls_sp.stdout, sycl_ls_sp.stderr
10051006
)
10061007
)
10071008
dev_sg_sizes.append(set())
@@ -1024,7 +1025,7 @@ def get_sycl_ls_verbose(sycl_device, env):
10241025
if not config.allow_unknown_arch:
10251026
lit_config.error(
10261027
"Cannot detect architecture for {}\nstdout:\n{}\nstderr:\n{}".format(
1027-
sycl_device, sp.stdout, sp.stderr
1028+
sycl_device, sycl_ls_sp.stdout, sycl_ls_sp.stderr
10281029
)
10291030
)
10301031
architectures = set()

0 commit comments

Comments
 (0)