@@ -39,14 +39,15 @@ from ._sycl_context cimport SyclContext
39
39
from ._sycl_device cimport SyclDevice
40
40
41
41
__all__ = [
42
+ " _global_device_queue_cache" ,
42
43
" device_context" ,
43
44
" get_current_backend" ,
44
45
" get_current_device_type" ,
45
46
" get_current_queue" ,
47
+ " get_device_cached_queue" ,
46
48
" get_num_activated_queues" ,
47
49
" is_in_device_context" ,
48
50
" set_global_queue" ,
49
- " _global_device_queue_cache" ,
50
51
]
51
52
52
53
_logger = logging.getLogger(__name__ )
@@ -344,7 +345,21 @@ _global_device_queue_cache = ContextVar(
344
345
345
346
346
347
cpdef 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
+ """
348
363
_cache = _global_device_queue_cache.get()
349
364
q_, changed_ = _cache.get_or_create(key)
350
365
if changed_: _global_device_queue_cache.set(_cache)
0 commit comments