Skip to content

Commit c5ed2a7

Browse files
Renamed get_sycl_backend method in SyclQueue to backend property
Removed name-sake property added to query the underlying sycl_device
1 parent c1895f7 commit c5ed2a7

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

dpctl/_sycl_queue.pyx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,12 @@ cdef class SyclQueue(_SyclQueue):
644644
else:
645645
return False
646646

647-
def get_sycl_backend(self):
648-
""" Returns the Sycl backend associated with the queue.
647+
@property
648+
def backend(self):
649+
""" Returns the backend_type enum value for this queue.
650+
651+
Returns:
652+
backend_type: The backend for the queue.
649653
"""
650654
cdef _backend_type BE = DPCTLQueue_GetBackend(self._queue_ref)
651655
if BE == _backend_type._OPENCL:
@@ -959,16 +963,6 @@ cdef class SyclQueue(_SyclQueue):
959963

960964
return SyclEvent._create(ERef, [])
961965

962-
@property
963-
def backend(self):
964-
"""Returns the backend_type enum value for the device
965-
associated with this queue.
966-
967-
Returns:
968-
backend_type: The backend for the device.
969-
"""
970-
return self.sycl_device.backend
971-
972966
@property
973967
def name(self):
974968
"""Returns the device name for the device

dpctl/tests/test_sycl_queue.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,8 @@ def test_queue_submit_barrier(valid_filter):
424424
ev3.wait()
425425
ev1.wait()
426426
ev2.wait()
427+
with pytest.raises(TypeError):
428+
q.submit_barrier(range(3))
427429

428430

429431
def test_queue__repr__():
@@ -488,6 +490,11 @@ def test_constructor_many_arg():
488490
dpctl.SyclQueue(None, None, None, None)
489491
with pytest.raises(TypeError):
490492
dpctl.SyclQueue(None, None)
493+
ctx = dpctl.SyclContext()
494+
with pytest.raises(TypeError):
495+
dpctl.SyclQueue(ctx, None)
496+
with pytest.raises(TypeError):
497+
dpctl.SyclQueue(ctx)
491498

492499

493500
def test_queue_wait():
@@ -510,3 +517,11 @@ def test_queue_memops():
510517
q.memcpy(m1, m2, 512)
511518
q.prefetch(m1, 512)
512519
q.mem_advise(m1, 512, 0)
520+
with pytest.raises(TypeError):
521+
q.memcpy(m1, list(), 512)
522+
with pytest.raises(TypeError):
523+
q.memcpy(list(), m2, 512)
524+
with pytest.raises(TypeError):
525+
q.prefetch(list(), 512)
526+
with pytest.raises(TypeError):
527+
q.mem_advise(list(), 512, 0)

0 commit comments

Comments
 (0)