Skip to content

Commit 500b67a

Browse files
committed
apply comments
Signed-off-by: Mateusz P. Nowak <mateusz.p.nowak@intel.com>
1 parent ed8add4 commit 500b67a

File tree

5 files changed

+22
-15
lines changed

5 files changed

+22
-15
lines changed

sycl/test-e2e/AddressSanitizer/lit.local.cfg

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,5 @@ unsupported_san_flags = [
3131
if any(flag in config.cxx_flags for flag in unsupported_san_flags):
3232
config.unsupported=True
3333

34-
if hasattr(config, 'ze_affinity_mask') and config.ze_affinity_mask is not None:
34+
if config.ze_affinity_mask is not None:
3535
config.environment["ZE_AFFINITY_MASK"] = config.ze_affinity_mask
36-
else:
37-
config.environment["ZE_AFFINITY_MASK"] = "0"

sycl/test-e2e/MemorySanitizer/lit.local.cfg

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,5 @@ unsupported_san_flags = [
3939
if any(flag in config.cxx_flags for flag in unsupported_san_flags):
4040
config.unsupported=True
4141

42-
if hasattr(config, 'ze_affinity_mask') and config.ze_affinity_mask is not None:
42+
if config.ze_affinity_mask is not None:
4343
config.environment["ZE_AFFINITY_MASK"] = config.ze_affinity_mask
44-
else:
45-
config.environment["ZE_AFFINITY_MASK"] = "0"

sycl/test-e2e/ThreadSanitizer/lit.local.cfg

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,5 @@ unsupported_san_flags = [
3434
if any(flag in config.cxx_flags for flag in unsupported_san_flags):
3535
config.unsupported=True
3636

37-
if hasattr(config, 'ze_affinity_mask') and config.ze_affinity_mask is not None:
37+
if config.ze_affinity_mask is not None:
3838
config.environment["ZE_AFFINITY_MASK"] = config.ze_affinity_mask
39-
else:
40-
config.environment["ZE_AFFINITY_MASK"] = "0"

sycl/test-e2e/format.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,9 @@ def get_extra_env(sycl_devices):
351351
elif "level_zero_v1" in full_dev_name:
352352
expanded += " env UR_LOADER_USE_LEVEL_ZERO_V2=0"
353353

354-
# If ZE_AFFINITY_MASK is set, it filters devices so we should use :0
354+
# If ZE_AFFINITY_MASK is set in local config, it filters devices so we should use :0
355355
device_selector = parsed_dev_name
356-
if "ZE_AFFINITY_MASK" in test.config.environment:
356+
if test.config.ze_affinity_mask is not None:
357357
backend, _ = parsed_dev_name.split(":", 1)
358358
device_selector = f"{backend}:0"
359359

sycl/test-e2e/lit.cfg.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
import shlex
1010
import shutil
1111

12+
import lit.formats
13+
import lit.util
14+
1215
from lit.llvm import llvm_config
1316
from lit.llvm.subst import ToolSubst, FindTool
1417

@@ -93,6 +96,7 @@
9396
"LIBCLANG_NOTHREADS",
9497
"LIBCLANG_RESOURCE_USAGE",
9598
"LIBCLANG_CODE_COMPLETION_LOGGING",
99+
"ZE_AFFINITY_MASK",
96100
]
97101

98102
# Names of the Release and Debug versions of the XPTIFW library
@@ -953,9 +957,8 @@ def get_sycl_ls_verbose(sycl_device, env):
953957
for sycl_device in remove_level_zero_suffix(config.sycl_devices):
954958
be, dev = sycl_device.split(":")
955959
if be == "level_zero" and dev.isdigit():
956-
if config.ze_affinity_mask is None:
957-
config.ze_affinity_mask = dev
958-
break
960+
config.ze_affinity_mask = dev
961+
break
959962

960963
for sycl_device in remove_level_zero_suffix(config.sycl_devices):
961964
be, dev = sycl_device.split(":")
@@ -1066,6 +1069,10 @@ def get_sycl_ls_verbose(sycl_device, env):
10661069
# Compute intersection of aspects.
10671070
aspects = set(dev_aspects[0]).intersection(*dev_aspects)
10681071
lit_config.note("Aspects for {}: {}".format(sycl_device, ", ".join(aspects)))
1072+
lit_config.note("Len of dev_aspects for {}: {}".format(sycl_device, len(dev_aspects)))
1073+
1074+
for i in range(len(dev_aspects)):
1075+
lit_config.note("DevAsp{} for {}: {}".format(i, sycl_device, ", ".join(dev_aspects[i])))
10691076

10701077
if dev_sg_sizes == []:
10711078
lit_config.error(
@@ -1121,9 +1128,15 @@ def get_sycl_ls_verbose(sycl_device, env):
11211128
features.update(sg_size_features)
11221129
features.update(architecture_feature)
11231130
features.update(device_family)
1124-
features.update(aspects)
11251131

11261132
be, dev = sycl_device.split(":")
1133+
if dev.isdigit():
1134+
backend_devices = available_devices.get(be, "gpu")
1135+
if isinstance(backend_devices, tuple):
1136+
# arch-selection is typically used to select gpu device
1137+
dev = "gpu"
1138+
else:
1139+
dev = backend_devices
11271140
features.add(dev.replace("fpga", "accelerator"))
11281141
if "level_zero_v2" in full_name:
11291142
features.add("level_zero_v2_adapter")

0 commit comments

Comments
 (0)