@@ -232,32 +232,40 @@ cdef class SyclDevice(_SyclDevice):
232
232
""" Python equivalent for cl::sycl::device class.
233
233
234
234
There are two ways of creating a SyclDevice instance:
235
- - by directly passing in a string to the class constructor.
236
235
237
- :Example:
236
+ - by directly passing in a filter string to the class constructor. The
237
+ filter string needs to conform to the the `DPC++ filter selector SYCL
238
+ extension <https://bit.ly/37kqANT>`_.
238
239
240
+ :Example:
239
241
.. code-block:: python
240
242
241
- import dpctl
243
+ import dpctl
242
244
243
- l0gpu = dpctl.SyclDevice("level0:gpu:0"):
244
- l0gpu.dump_device_info()
245
+ # Create a SyclDevice with an explicit filter string, in
246
+ # this case the first level_zero gpu device.
247
+ level_zero_gpu = dpctl.SyclDevice("level_zero:gpu:0"):
248
+ level_zero_gpu.dump_device_info()
245
249
246
250
- by calling one of the device selector helper functions:
247
- :py:meth:`~dpctl.select_accelerator_device`,
248
- :py:meth:`~dpctl.select_cpu_device`,
249
- :py:meth:`~dpctl.select_default_device`,
250
- :py:meth:`~dpctl.select_gpu_device`,
251
- :py:meth:`~dpctl.select_host_device`.
252
251
253
- :Example:
252
+ :func:`dpctl.select_accelerator_device()`,
253
+ :func:`dpctl.select_cpu_device()`,
254
+ :func:`dpctl.select_default_device()`,
255
+ :func:`dpctl.select_gpu_device()`,
256
+ :func:`dpctl.select_host_device()`.
254
257
258
+
259
+ :Example:
255
260
.. code-block:: python
256
261
257
- import dpctl
262
+ import dpctl
263
+
264
+ # Create a SyclDevice of type GPU based on whatever is returned
265
+ # by the SYCL `gpu_selector` device selector class.
266
+ gpu = dpctl.select_gpu_device():
267
+ gpu.dump_device_info()
258
268
259
- gpu = dpctl.select_gpu_device():
260
- gpu.dump_device_info()
261
269
"""
262
270
263
271
@staticmethod
0 commit comments