@@ -303,8 +303,14 @@ cdef class _DeviceDefaultQueueCache:
303
303
self .__device_queue_map__ = dict ()
304
304
305
305
def get_or_create (self , key ):
306
- """ Return instance of SyclQueue and indicator if cache has been modified"""
307
- if isinstance (key, tuple ) and len (key) == 2 and isinstance (key[0 ], SyclContext) and isinstance (key[1 ], SyclDevice):
306
+ """ Return instance of SyclQueue and indicator if cache
307
+ has been modified"""
308
+ if (
309
+ isinstance (key, tuple )
310
+ and len (key) == 2
311
+ and isinstance (key[0 ], SyclContext)
312
+ and isinstance (key[1 ], SyclDevice)
313
+ ):
308
314
ctx_dev = key
309
315
q = None
310
316
elif isinstance (key, SyclDevice):
@@ -325,12 +331,16 @@ cdef class _DeviceDefaultQueueCache:
325
331
self .__device_queue_map__.update(dev_queue_map)
326
332
327
333
def __copy__ (self ):
328
- cdef _DeviceDefaultQueueCache _copy = _DeviceDefaultQueueCache.__new__ (_DeviceDefaultQueueCache)
334
+ cdef _DeviceDefaultQueueCache _copy = _DeviceDefaultQueueCache.__new__ (
335
+ _DeviceDefaultQueueCache)
329
336
_copy._update_map(self .__device_queue_map__)
330
337
return _copy
331
338
332
339
333
- _global_device_queue_cache = ContextVar(' global_device_queue_cache' , default = _DeviceDefaultQueueCache())
340
+ _global_device_queue_cache = ContextVar(
341
+ ' global_device_queue_cache' ,
342
+ default = _DeviceDefaultQueueCache()
343
+ )
334
344
335
345
336
346
cpdef object get_device_cached_queue(object key):
0 commit comments