Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions sycl/test-e2e/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@
sp = subprocess.run((cmd), env=llvm_config.config.environment,
shell=True, capture_output=True, text=True)
if sp.returncode != 0:
lit_config.error('Cannot list device aspects for {}:{}\nstdout:\n{}\nstderr:\n'.format(
be, device, sp.stdout, sp.stderr))
lit_config.error('Cannot list device aspects for {}\nstdout:\n{}\nstderr:\n{}'.format(
sycl_device, sp.stdout, sp.stderr))

dev_aspects = []
dev_sg_sizes = []
Expand All @@ -394,25 +394,22 @@
dev_sg_sizes.append(sg_sizes_str.strip().split(' '))

if dev_aspects == []:
lit_config.error('Cannot detect device aspect for {}\nstdout:\n{}\nstderr:\n'.format(
lit_config.error('Cannot detect device aspect for {}\nstdout:\n{}\nstderr:\n{}'.format(
sycl_device, sp.stdout, sp.stderr))
dev_aspects.append(set())
else:
# We might have several devices matching the same filter in the system.
# Compute intersection of aspects.
aspects = set(dev_aspects[0]).intersection(*dev_aspects)
lit_config.note('Aspects for {}: {}'.format(sycl_device, ', '.join(aspects)))
# We might have several devices matching the same filter in the system.
# Compute intersection of aspects.
aspects = set(dev_aspects[0]).intersection(*dev_aspects)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you removing the else:? Won't it result in python exception in dev_aspects[0] in this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No because if dev_aspects is empty, we're already appending an empty set() on line 399.

lit_config.note('Aspects for {}: {}'.format(sycl_device, ', '.join(aspects)))

if dev_sg_sizes == []:
lit_config.error('Cannot detect device SG sizes for {}\nstdout:\n{}\nstderr:\n'.format(
lit_config.error('Cannot detect device SG sizes for {}\nstdout:\n{}\nstderr:\n{}'.format(
sycl_device, sp.stdout, sp.stderr))
dev_sg_sizes.append(set())
else:
# We might have several devices matching the same filter in the system.
# Compute intersection of aspects.
sg_sizes = set(dev_sg_sizes[0]).intersection(*dev_sg_sizes)
lit_config.note('SG sizes for {}: {}'.format(sycl_device, ', '.join(sg_sizes)))

# We might have several devices matching the same filter in the system.
# Compute intersection of aspects.
sg_sizes = set(dev_sg_sizes[0]).intersection(*dev_sg_sizes)
lit_config.note('SG sizes for {}: {}'.format(sycl_device, ', '.join(sg_sizes)))

aspect_features = set('aspect-' + a for a in aspects)
sg_size_features = set('sg-' + s for s in sg_sizes)
Expand Down