@@ -24,6 +24,7 @@ from libc.stdint cimport int32_t, int64_t, uint8_t, uint16_t, uint64_t
24
24
25
25
cimport dpctl as c_dpctl
26
26
cimport dpctl.memory as c_dpmem
27
+ from dpctl._sycl_queue_manager cimport get_device_cached_queue
27
28
28
29
from .._backend cimport (
29
30
DPCTLDevice_Delete,
@@ -344,12 +345,12 @@ cpdef usm_ndarray from_dlpack_capsule(object py_caps) except +:
344
345
if _IS_LINUX:
345
346
default_context = root_device.sycl_platform.default_context
346
347
else :
347
- default_context = dpctl.SyclQueue (root_device).sycl_context
348
+ default_context = get_device_cached_queue (root_device).sycl_context
348
349
except RuntimeError :
349
- default_context = dpctl.SyclQueue (root_device).sycl_context
350
+ default_context = get_device_cached_queue (root_device).sycl_context
350
351
if dlm_tensor.dl_tensor.data is NULL :
351
352
usm_type = b" device"
352
- q = dpctl.SyclQueue( default_context, root_device)
353
+ q = get_device_cached_queue(( default_context, root_device,) )
353
354
else :
354
355
usm_type = c_dpmem._Memory.get_pointer_type(
355
356
< DPCTLSyclUSMRef> dlm_tensor.dl_tensor.data,
@@ -364,7 +365,7 @@ cpdef usm_ndarray from_dlpack_capsule(object py_caps) except +:
364
365
< DPCTLSyclUSMRef> dlm_tensor.dl_tensor.data,
365
366
< c_dpctl.SyclContext> default_context
366
367
)
367
- q = dpctl.SyclQueue( default_context, alloc_device)
368
+ q = get_device_cached_queue(( default_context, alloc_device,) )
368
369
if dlm_tensor.dl_tensor.dtype.bits % 8 :
369
370
raise BufferError(
370
371
" Can not import DLPack tensor whose element's "
0 commit comments