@@ -319,16 +319,14 @@ cdef class SyclQueue(_SyclQueue):
319319 raise SyclQueueCreationError(
320320 " SYCL Context could not be created from '{}'." .format(arg)
321321 )
322- elif status == - 4 :
322+ elif status == - 4 or status == - 6 :
323323 if len_args == 2 :
324324 arg = args
325325 raise SyclQueueCreationError(
326326 " SYCL Queue failed to be created from '{}'." .format(arg)
327327 )
328328 elif status == - 5 :
329329 raise TypeError (" Input capsule {} contains a null pointer or could not be renamed" .format(arg))
330- elif status == - 6 :
331- raise " SYCL Queue failed to be created from '{}'." .format(arg)
332330
333331 cdef int _init_queue_from__SyclQueue(self , _SyclQueue other):
334332 """ Copy data container _SyclQueue fields over.
@@ -601,12 +599,27 @@ cdef class SyclQueue(_SyclQueue):
601599
602600 return ret
603601
604- cpdef cpp_bool equals(self , SyclQueue q):
605- """ Returns true if the SyclQueue argument has the same _queue_ref
602+ cdef cpp_bool equals(self , SyclQueue q):
603+ """ Returns true if the SyclQueue argument `q` has the same _queue_ref
606604 as this SyclQueue.
607605 """
608606 return DPCTLQueue_AreEq(self ._queue_ref, q.get_queue_ref())
609607
608+ def __eq__ (self , other ):
609+ """
610+ Returns True if two :class:`dpctl.SyclQueue` compared arguments have
611+ the same underlying ``DPCTLSyclQueueRef`` object.
612+
613+ Returns:
614+ :obj:`bool`: ``True`` if the two :class:`dpctl.SyclQueue` objects
615+ point to the same ``DPCTLSyclQueueRef`` object, otherwise
616+ ``False``.
617+ """
618+ if isinstance (other, SyclQueue):
619+ return self .equals(< SyclQueue> other)
620+ else :
621+ return False
622+
610623 def get_sycl_backend (self ):
611624 """ Returns the Sycl backend associated with the queue.
612625 """
0 commit comments