Skip to content

Commit cee5afe

Browse files
Removed aspect_host, select_host_device, has_host_device
Host device has been removed from DPC++ compiler in 2023.0.0 Also removed support for host device type and for backend host.
1 parent 72622e0 commit cee5afe

11 files changed

+0
-91
lines changed

dpctl/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@
4848
has_accelerator_devices,
4949
has_cpu_devices,
5050
has_gpu_devices,
51-
has_host_device,
5251
select_accelerator_device,
5352
select_cpu_device,
5453
select_default_device,
5554
select_gpu_device,
56-
select_host_device,
5755
)
5856
from ._sycl_event import SyclEvent
5957
from ._sycl_platform import SyclPlatform, get_platforms, lsplatform

dpctl/_backend.pxd

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ cdef extern from "syclinterface/dpctl_sycl_enum_types.h":
3737
ctypedef enum _backend_type 'DPCTLSyclBackendType':
3838
_ALL_BACKENDS 'DPCTL_ALL_BACKENDS'
3939
_CUDA 'DPCTL_CUDA'
40-
_HOST 'DPCTL_HOST'
4140
_LEVEL_ZERO 'DPCTL_LEVEL_ZERO'
4241
_OPENCL 'DPCTL_OPENCL'
4342
_UNKNOWN_BACKEND 'DPCTL_UNKNOWN_BACKEND'
@@ -49,7 +48,6 @@ cdef extern from "syclinterface/dpctl_sycl_enum_types.h":
4948
_CPU 'DPCTL_CPU'
5049
_CUSTOM 'DPCTL_CUSTOM'
5150
_GPU 'DPCTL_GPU'
52-
_HOST_DEVICE 'DPCTL_HOST_DEVICE'
5351
_UNKNOWN_DEVICE 'DPCTL_UNKNOWN_DEVICE'
5452

5553
ctypedef enum _arg_data_type 'DPCTLKernelArgType':
@@ -236,7 +234,6 @@ cdef extern from "syclinterface/dpctl_sycl_device_selector_interface.h":
236234
DPCTLSyclDeviceSelectorRef DPCTLCPUSelector_Create()
237235
DPCTLSyclDeviceSelectorRef DPCTLFilterSelector_Create(const char *)
238236
DPCTLSyclDeviceSelectorRef DPCTLGPUSelector_Create()
239-
DPCTLSyclDeviceSelectorRef DPCTLHostSelector_Create()
240237
void DPCTLDeviceSelector_Delete(DPCTLSyclDeviceSelectorRef)
241238
int DPCTLDeviceSelector_Score(DPCTLSyclDeviceSelectorRef, DPCTLSyclDeviceRef)
242239

dpctl/_sycl_device.pyx

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ cdef list _get_devices(DPCTLDeviceVectorRef DVRef):
162162
cdef str _backend_type_to_filter_string_part(_backend_type BTy):
163163
if BTy == _backend_type._CUDA:
164164
return "cuda"
165-
elif BTy == _backend_type._HOST:
166-
return "host"
167165
elif BTy == _backend_type._LEVEL_ZERO:
168166
return "level_zero"
169167
elif BTy == _backend_type._OPENCL:
@@ -181,8 +179,6 @@ cdef str _device_type_to_filter_string_part(_device_type DTy):
181179
return "cpu"
182180
elif DTy == _device_type._GPU:
183181
return "gpu"
184-
elif DTy == _device_type._HOST_DEVICE:
185-
return "host"
186182
else:
187183
return "unknown"
188184

@@ -222,7 +218,6 @@ cdef class SyclDevice(_SyclDevice):
222218
:func:`dpctl.select_cpu_device()`,
223219
:func:`dpctl.select_default_device()`,
224220
:func:`dpctl.select_gpu_device()`,
225-
:func:`dpctl.select_host_device()`.
226221
227222
228223
:Example:
@@ -359,8 +354,6 @@ cdef class SyclDevice(_SyclDevice):
359354
)
360355
if BTy == _backend_type._CUDA:
361356
return backend_type.cuda
362-
elif BTy == _backend_type._HOST:
363-
return backend_type.host
364357
elif BTy == _backend_type._LEVEL_ZERO:
365358
return backend_type.level_zero
366359
elif BTy == _backend_type._OPENCL:
@@ -388,21 +381,9 @@ cdef class SyclDevice(_SyclDevice):
388381
return device_type.cpu
389382
elif DTy == _device_type._GPU:
390383
return device_type.gpu
391-
elif DTy == _device_type._HOST_DEVICE:
392-
return device_type.host
393384
else:
394385
raise ValueError("Unknown device type.")
395386

396-
@property
397-
def has_aspect_host(self):
398-
""" Returns True if this device is a host device, False otherwise.
399-
400-
Returns:
401-
bool: Indicates if the device is a host device.
402-
"""
403-
cdef _aspect_type AT = _aspect_type._host
404-
return DPCTLDevice_HasAspect(self._device_ref, AT)
405-
406387
@property
407388
def has_aspect_cpu(self):
408389
""" Returns True if this device is a CPU device, False otherwise.

dpctl/_sycl_device_factory.pxd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ cpdef SyclDevice select_accelerator_device()
3131
cpdef SyclDevice select_cpu_device()
3232
cpdef SyclDevice select_default_device()
3333
cpdef SyclDevice select_gpu_device()
34-
cpdef SyclDevice select_host_device()
3534
cpdef list get_devices(backend=*, device_type=*)
3635
cpdef int get_num_devices(backend=*, device_type=*)
3736
cpdef cpp_bool has_gpu_devices()
3837
cpdef cpp_bool has_cpu_devices()
3938
cpdef cpp_bool has_accelerator_devices()
40-
cpdef cpp_bool has_host_device()

dpctl/_sycl_device_factory.pyx

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ from ._backend cimport ( # noqa: E211
3939
DPCTLDeviceVector_Size,
4040
DPCTLDeviceVectorRef,
4141
DPCTLGPUSelector_Create,
42-
DPCTLHostSelector_Create,
4342
DPCTLSyclDeviceRef,
4443
DPCTLSyclDeviceSelectorRef,
4544
_backend_type,
@@ -56,12 +55,10 @@ __all__ = [
5655
"select_cpu_device",
5756
"select_default_device",
5857
"select_gpu_device",
59-
"select_host_device",
6058
"get_num_devices",
6159
"has_cpu_devices",
6260
"has_gpu_devices",
6361
"has_accelerator_devices",
64-
"has_host_device",
6562
]
6663

6764

@@ -71,8 +68,6 @@ cdef _backend_type _string_to_dpctl_sycl_backend_ty(str backend_str):
7168
return _backend_type._ALL_BACKENDS
7269
elif backend_str == "cuda":
7370
return _backend_type._CUDA
74-
elif backend_str == "host":
75-
return _backend_type._HOST
7671
elif backend_str == "level_zero":
7772
return _backend_type._LEVEL_ZERO
7873
elif backend_str == "opencl":
@@ -95,8 +90,6 @@ cdef _device_type _string_to_dpctl_sycl_device_ty(str dty_str):
9590
return _device_type._CUSTOM
9691
elif dty_str == "gpu":
9792
return _device_type._GPU
98-
elif dty_str == "host":
99-
return _device_type._HOST_DEVICE
10093
else:
10194
return _device_type._UNKNOWN_DEVICE
10295

@@ -106,8 +99,6 @@ cdef _backend_type _enum_to_dpctl_sycl_backend_ty(BTy):
10699
return _backend_type._ALL_BACKENDS
107100
elif BTy == backend_type.cuda:
108101
return _backend_type._CUDA
109-
elif BTy == backend_type.host:
110-
return _backend_type._HOST
111102
elif BTy == backend_type.level_zero:
112103
return _backend_type._LEVEL_ZERO
113104
elif BTy == backend_type.opencl:
@@ -129,8 +120,6 @@ cdef _device_type _enum_to_dpctl_sycl_device_ty(DTy):
129120
return _device_type._CUSTOM
130121
elif DTy == device_type_t.gpu:
131122
return _device_type._GPU
132-
elif DTy == device_type_t.host:
133-
return _device_type._HOST_DEVICE
134123
else:
135124
return _device_type._UNKNOWN_DEVICE
136125

@@ -288,19 +277,6 @@ cpdef cpp_bool has_accelerator_devices():
288277
return <cpp_bool>num_accelerator_dev
289278

290279

291-
cpdef cpp_bool has_host_device():
292-
""" A helper function to check if there are any SYCL Host devices available.
293-
294-
Returns:
295-
bool: ``True`` if ``sycl::device_type::host`` devices are present,
296-
``False`` otherwise.
297-
"""
298-
cdef int num_host_dev = DPCTLDeviceMgr_GetNumDevices(
299-
_device_type._HOST_DEVICE
300-
)
301-
return <cpp_bool>num_host_dev
302-
303-
304280
cpdef SyclDevice select_accelerator_device():
305281
""" A wrapper for SYCL's ``accelerator_selector`` class.
306282
@@ -379,23 +355,3 @@ cpdef SyclDevice select_gpu_device():
379355
raise SyclDeviceCreationError("Device unavailable.")
380356
Device = SyclDevice._create(DRef)
381357
return Device
382-
383-
384-
cpdef SyclDevice select_host_device():
385-
""" A wrapper for SYCL's ``host_selector`` class.
386-
387-
Returns:
388-
dpctl.SyclDevice: A Python object wrapping the SYCL ``device``
389-
returned by the SYCL ``host_selector``.
390-
Raises:
391-
dpctl.SyclDeviceCreationError: If the SYCL ``host_selector`` is
392-
unable to select a ``device``.
393-
"""
394-
cdef DPCTLSyclDeviceSelectorRef DSRef = DPCTLHostSelector_Create()
395-
cdef DPCTLSyclDeviceRef DRef = DPCTLDevice_CreateFromSelector(DSRef)
396-
# Free up the device selector
397-
DPCTLDeviceSelector_Delete(DSRef)
398-
if DRef is NULL:
399-
raise SyclDeviceCreationError("Host device is unavailable.")
400-
Device = SyclDevice._create(DRef)
401-
return Device

dpctl/_sycl_event.pyx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,6 @@ cdef class SyclEvent(_SyclEvent):
302302
return backend_type.opencl
303303
elif BE == _backend_type._LEVEL_ZERO:
304304
return backend_type.level_zero
305-
elif BE == _backend_type._HOST:
306-
return backend_type.host
307305
elif BE == _backend_type._CUDA:
308306
return backend_type.cuda
309307
else:

dpctl/_sycl_platform.pyx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,6 @@ cdef class SyclPlatform(_SyclPlatform):
251251
)
252252
if BTy == _backend_type._CUDA:
253253
return backend_type.cuda
254-
elif BTy == _backend_type._HOST:
255-
return backend_type.host
256254
elif BTy == _backend_type._LEVEL_ZERO:
257255
return backend_type.level_zero
258256
elif BTy == _backend_type._OPENCL:

dpctl/_sycl_queue.pyx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,6 @@ cdef class SyclQueue(_SyclQueue):
676676
return backend_type.opencl
677677
elif BE == _backend_type._LEVEL_ZERO:
678678
return backend_type.level_zero
679-
elif BE == _backend_type._HOST:
680-
return backend_type.host
681679
elif BE == _backend_type._CUDA:
682680
return backend_type.cuda
683681
else:

dpctl/enum_types.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class device_type(Enum):
5454
cpu = auto()
5555
custom = auto()
5656
gpu = auto()
57-
host = auto()
5857

5958

6059
class backend_type(Enum):
@@ -74,7 +73,6 @@ class backend_type(Enum):
7473

7574
all = auto()
7675
cuda = auto()
77-
host = auto()
7876
level_zero = auto()
7977
opencl = auto()
8078

dpctl/tests/_device_attributes_checks.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
dpctl.select_cpu_device,
2424
dpctl.select_default_device,
2525
dpctl.select_gpu_device,
26-
dpctl.select_host_device,
2726
]
2827

2928
list_of_valid_filter_selectors = [
@@ -120,13 +119,6 @@ def check_sub_group_sizes(device):
120119
assert all(el > 0 for el in sg_sizes)
121120

122121

123-
def check_has_aspect_host(device):
124-
try:
125-
device.has_aspect_host
126-
except Exception:
127-
pytest.fail("has_aspect_host call failed")
128-
129-
130122
def check_has_aspect_cpu(device):
131123
try:
132124
device.has_aspect_cpu
@@ -634,7 +626,6 @@ def check_global_mem_cache_line_size(device):
634626
check_preferred_vector_width_float,
635627
check_preferred_vector_width_double,
636628
check_preferred_vector_width_half,
637-
check_has_aspect_host,
638629
check_has_aspect_cpu,
639630
check_has_aspect_gpu,
640631
check_has_aspect_accelerator,

dpctl/tests/test_sycl_device_factory.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,20 @@
2727
(bty.level_zero, dty.gpu),
2828
(bty.opencl, dty.gpu),
2929
(bty.opencl, dty.cpu),
30-
(bty.host, dty.host),
3130
]
3231

3332
argument_list_2 = [
34-
("host", "host"),
3533
("level_zero", "gpu"),
3634
("opencl", "gpu"),
3735
("opencl", "cpu"),
3836
]
3937

4038
list_of_backend_str = [
41-
"host",
4239
"level_zero",
4340
"opencl",
4441
]
4542

4643
list_of_device_type_str = [
47-
"host",
4844
"gpu",
4945
"cpu",
5046
]

0 commit comments

Comments
 (0)