@@ -762,27 +762,37 @@ def remove_level_zero_suffix(devices):
762
762
# discovered already.
763
763
config .sycl_dev_features = {}
764
764
765
+
765
766
# Function to check if multi-device-emulation feature is available
766
767
def check_multi_device_emulation (device ):
767
768
try :
768
769
with test_env ():
769
770
cmd = "{} {}" .format (config .run_launcher or "" , sycl_ls )
770
771
mod_env = os .environ .copy ()
771
772
mod_env ["ONEAPI_DEVICE_SELECTOR" ] = device
772
- sp = subprocess .run (cmd , env = mod_env , text = True , shell = True , capture_output = True )
773
+ sp = subprocess .run (
774
+ cmd , env = mod_env , text = True , shell = True , capture_output = True
775
+ )
773
776
sp .check_returncode ()
774
- regular_device_count = sum (1 for line in sp .stdout .splitlines () if line .startswith ("[" ))
777
+ regular_device_count = sum (
778
+ 1 for line in sp .stdout .splitlines () if line .startswith ("[" )
779
+ )
775
780
mod_env ["NEOReadDebugKeys" ] = "1"
776
781
mod_env ["CreateMultipleRootDevices" ] = str (regular_device_count * 2 )
777
- sp = subprocess .run (cmd , env = mod_env , text = True , shell = True , capture_output = True )
782
+ sp = subprocess .run (
783
+ cmd , env = mod_env , text = True , shell = True , capture_output = True
784
+ )
778
785
sp .check_returncode ()
779
- emulated_device_count = sum (1 for line in sp .stdout .splitlines () if line .startswith ("[" ))
786
+ emulated_device_count = sum (
787
+ 1 for line in sp .stdout .splitlines () if line .startswith ("[" )
788
+ )
780
789
if emulated_device_count == regular_device_count * 2 :
781
790
return True
782
791
return False
783
792
except Exception as e :
784
793
return False
785
794
795
+
786
796
# Version of the driver for a given device. Empty for non-Intel devices.
787
797
config .intel_driver_ver = {}
788
798
for full_name , sycl_device in zip (
@@ -931,7 +941,9 @@ def check_multi_device_emulation(device):
931
941
# Add corresponding target feature
932
942
target = config .backend_to_target [be ]
933
943
features .add (target )
934
- if (sycl_device == "opencl:gpu" or sycl_device == "level_zero:gpu" ) and check_multi_device_emulation (sycl_device ):
944
+ if (
945
+ sycl_device == "opencl:gpu" or sycl_device == "level_zero:gpu"
946
+ ) and check_multi_device_emulation (sycl_device ):
935
947
features .add ("multi-device-emulation" )
936
948
937
949
if be == "hip" :
0 commit comments