File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 6666 get_current_backend ,
6767 get_current_device_type ,
6868 get_current_queue ,
69+ get_device_cached_queue ,
6970 get_num_activated_queues ,
7071 is_in_device_context ,
7172 nested_context_factories ,
123124 "get_current_backend" ,
124125 "get_current_device_type" ,
125126 "get_current_queue" ,
127+ "get_device_cached_queue" ,
126128 "get_num_activated_queues" ,
127129 "is_in_device_context" ,
128130 "nested_context_factories" ,
Original file line number Diff line number Diff line change @@ -39,14 +39,15 @@ from ._sycl_context cimport SyclContext
3939from ._sycl_device cimport SyclDevice
4040
4141__all__ = [
42+ " _global_device_queue_cache" ,
4243 " device_context" ,
4344 " get_current_backend" ,
4445 " get_current_device_type" ,
4546 " get_current_queue" ,
47+ " get_device_cached_queue" ,
4648 " get_num_activated_queues" ,
4749 " is_in_device_context" ,
4850 " set_global_queue" ,
49- " _global_device_queue_cache" ,
5051]
5152
5253_logger = logging.getLogger(__name__ )
@@ -344,7 +345,21 @@ _global_device_queue_cache = ContextVar(
344345
345346
346347cpdef object get_device_cached_queue(object key):
347- """ Get cached queue associated with given device"""
348+ """ Returns a cached queue associated with given device.
349+
350+ Args:
351+ key : Either a 2-tuple consisting of a :class:`dpctl.SyclContext` and
352+ a :class:`dpctl.SyclDevice`, or a :class:`dpctl.SyclDevice`
353+ instance, or a filter string identifying a device.
354+
355+ Returns:
356+ :class:`dpctl.SyclQueue`: A cached SYCL queue associated with the
357+ input device.
358+
359+ Raises:
360+ TypeError: If the input key is not one of the accepted types.
361+
362+ """
348363 _cache = _global_device_queue_cache.get()
349364 q_, changed_ = _cache.get_or_create(key)
350365 if changed_: _global_device_queue_cache.set(_cache)
You can’t perform that action at this time.
0 commit comments