We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 98ec732 commit 3cd9cafCopy full SHA for 3cd9caf
1 file changed
dpctl/tests/test_sycl_queue_manager.py
@@ -226,3 +226,22 @@ def test_nested_context_factory_exception_if_wrong_factory(
226
with _register_nested_context_factory(factory):
227
with dpctl.device_context("opencl:cpu:0"):
228
pass
229
+
230
231
+def test__DeviceDefaultQueueCache():
232
+ import copy
233
234
+ from dpctl._sycl_queue_manager import _global_device_queue_cache as cache
235
+ from dpctl._sycl_queue_manager import get_device_cached_queue
236
237
+ try:
238
+ d = dpctl.SyclDevice()
239
+ except dpctl.SyclDeviceCreationError:
240
+ pytest.skip("Could not create default device")
241
242
+ q1 = get_device_cached_queue(d)
243
+ cache_copy = copy.copy(cache.get())
244
+ q2, changed = cache_copy.get_or_create(d)
245
246
+ assert not changed
247
+ assert q1 == q2
0 commit comments