File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -295,6 +295,15 @@ cdef class _Memory:
295
295
def __get__ (self ):
296
296
return self .queue.get_sycl_device()
297
297
298
+ property sycl_queue :
299
+ """
300
+ :class:`dpctl.SyclQueue` with :class:`dpctl.SyclContext` the
301
+ USM allocation is bound to and :class:`dpctl.SyclDevice` it was
302
+ allocated on.
303
+ """
304
+ def __get__ (self ):
305
+ return self .queue
306
+
298
307
def __repr__ (self ):
299
308
return (
300
309
" <SYCL(TM) USM-{} allocation of {} bytes at {}>"
Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ def test_memory_create(memory_ctor):
59
59
assert len (mobj ) == nbytes
60
60
assert mobj .size == nbytes
61
61
assert mobj ._context == queue .sycl_context
62
+ assert mobj ._queue == queue
63
+ assert mobj .sycl_queue == queue
62
64
assert type (repr (mobj )) is str
63
65
assert type (bytes (mobj )) is bytes
64
66
assert sys .getsizeof (mobj ) > nbytes
@@ -495,7 +497,7 @@ def test_with_constructor(memory_ctor):
495
497
shape = (64 ,),
496
498
strides = (1 ,),
497
499
offset = 0 ,
498
- syclobj = buf ._queue ._get_capsule (),
500
+ syclobj = buf .sycl_queue ._get_capsule (),
499
501
)
500
502
check_view (v )
501
503
# Use context capsule
You can’t perform that action at this time.
0 commit comments