Skip to content

Commit 790b47a

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

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
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: 13 additions & 5 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,7 +96,7 @@
9396
"LIBCLANG_NOTHREADS",
9497
"LIBCLANG_RESOURCE_USAGE",
9598
"LIBCLANG_CODE_COMPLETION_LOGGING",
96-
]
99+
"ZE_AFFINITY_MASK",git tr
97100

98101
# Names of the Release and Debug versions of the XPTIFW library
99102
XPTIFW_RELEASE = "xptifw"
@@ -953,9 +956,8 @@ def get_sycl_ls_verbose(sycl_device, env):
953956
for sycl_device in remove_level_zero_suffix(config.sycl_devices):
954957
be, dev = sycl_device.split(":")
955958
if be == "level_zero" and dev.isdigit():
956-
if config.ze_affinity_mask is None:
957-
config.ze_affinity_mask = dev
958-
break
959+
config.ze_affinity_mask = dev
960+
break
959961

960962
for sycl_device in remove_level_zero_suffix(config.sycl_devices):
961963
be, dev = sycl_device.split(":")
@@ -1121,9 +1123,15 @@ def get_sycl_ls_verbose(sycl_device, env):
11211123
features.update(sg_size_features)
11221124
features.update(architecture_feature)
11231125
features.update(device_family)
1124-
features.update(aspects)
11251126

11261127
be, dev = sycl_device.split(":")
1128+
if dev.isdigit():
1129+
backend_devices = available_devices.get(be, "gpu")
1130+
if isinstance(backend_devices, tuple):
1131+
# arch-selection is typically used to select gpu device
1132+
dev = "gpu"
1133+
else:
1134+
dev = backend_devices
11271135
features.add(dev.replace("fpga", "accelerator"))
11281136
if "level_zero_v2" in full_name:
11291137
features.add("level_zero_v2_adapter")

0 commit comments

Comments
 (0)