Skip to content

Commit ad31122

Browse files
Change to SyclQueue.__repr__ to reflect property
``` In [1]: import dpctl In [2]: dpctl.SyclQueue() Out[2]: <dpctl.SyclQueue at 0x7f8752c07b90> In [3]: dpctl.SyclQueue(property='in_order') Out[3]: <dpctl.SyclQueue at 0x7f87494f4870, property=['in_order']> In [4]: dpctl.SyclQueue(property=['in_order']) Out[4]: <dpctl.SyclQueue at 0x7f8753587f00, property=['in_order']> In [5]: dpctl.SyclQueue(property=['in_order', 'enable_profiling']) Out[5]: <dpctl.SyclQueue at 0x7f8734016eb0, property=['in_order', 'enable_profling']> ```
1 parent 15be3a0 commit ad31122

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

dpctl/_sycl_queue.pyx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,11 +864,17 @@ cdef class SyclQueue(_SyclQueue):
864864

865865
def __repr__(self):
866866
cdef cpp_bool in_order = DPCTLQueue_IsInOrder(self._queue_ref)
867-
if in_order:
867+
cdef cpp_bool en_prof = DPCTLQueue_HasEnableProfiling(self._queue_ref)
868+
if in_order or en_prof:
869+
prop = []
870+
if in_order:
871+
prop.append("in_order")
872+
if en_prof:
873+
prop.append("enable_profiling")
868874
return (
869875
"<dpctl."
870876
+ self.__name__
871-
+ " at {}, property=in_order>".format(hex(id(self)))
877+
+ " at {}, property={}>".format(hex(id(self)), prop)
872878
)
873879
else:
874880
return "<dpctl." + self.__name__ + " at {}>".format(hex(id(self)))

0 commit comments

Comments
 (0)