File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ from ._backend cimport ( # noqa: E211
34
34
DPCTLContext_Delete,
35
35
DPCTLContext_DeviceCount,
36
36
DPCTLContext_GetDevices,
37
+ DPCTLContext_Hash,
37
38
DPCTLDevice_Copy,
38
39
DPCTLDevice_Delete,
39
40
DPCTLDeviceMgr_GetCachedContext,
@@ -337,11 +338,10 @@ cdef class SyclContext(_SyclContext):
337
338
338
339
def __hash__ (self ):
339
340
"""
340
- Return a Py_ssize_t hash value by using the address of the
341
- ``DPCTLSyclContextRef`` pointer stored in ``self._ctxt_ref``.
341
+ Returns hash value corresponding to ``self._ctxt_ref``.
342
342
343
343
"""
344
- return hash (self .addressof_ref() )
344
+ return DPCTLContext_Hash (self ._ctxt_ref )
345
345
346
346
cdef DPCTLSyclContextRef get_context_ref(self ):
347
347
return self ._ctxt_ref
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ from ._backend cimport ( # noqa: E211
58
58
DPCTLDevice_GetSubGroupIndependentForwardProgress,
59
59
DPCTLDevice_GetVendor,
60
60
DPCTLDevice_HasAspect,
61
+ DPCTLDevice_Hash,
61
62
DPCTLDevice_IsAccelerator,
62
63
DPCTLDevice_IsCPU,
63
64
DPCTLDevice_IsGPU,
@@ -711,11 +712,10 @@ cdef class SyclDevice(_SyclDevice):
711
712
712
713
def __hash__ (self ):
713
714
"""
714
- Return a Py_ssize_t hash value by using the address of the
715
- ``DPCTLSyclDeviceRef`` pointer stored in ``self._device_ref``.
715
+ Returns hash value corresponding to ``self._device_ref``.
716
716
717
717
"""
718
- return hash (self .addressof_ref() )
718
+ return DPCTLDevice_Hash (self ._device_ref )
719
719
720
720
cdef list create_sub_devices_equally(self , size_t count):
721
721
""" Returns a list of sub-devices partitioned from this SYCL device
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ from ._backend cimport ( # noqa: E211
38
38
DPCTLQueue_GetBackend,
39
39
DPCTLQueue_GetContext,
40
40
DPCTLQueue_GetDevice,
41
+ DPCTLQueue_Hash,
41
42
DPCTLQueue_IsInOrder,
42
43
DPCTLQueue_MemAdvise,
43
44
DPCTLQueue_Memcpy,
@@ -865,11 +866,10 @@ cdef class SyclQueue(_SyclQueue):
865
866
866
867
def __hash__ (self ):
867
868
"""
868
- Return a Py_ssize_t hash value by using the address of the
869
- ``DPCTLSyclQueueRef`` pointer stored in ``self._queue_ref``.
869
+ Returns hash value corresponding to ``self._queue_ref``.
870
870
871
871
"""
872
- return hash (self .addressof_ref() )
872
+ return DPCTLQueue_Hash (self ._queue_ref )
873
873
874
874
def _get_capsule (self ):
875
875
cdef DPCTLSyclQueueRef QRef = NULL
You can’t perform that action at this time.
0 commit comments