Skip to content

Commit bea77e2

Browse files
committed
ensure the path variable is from the same scope
1 parent 2dd757f commit bea77e2

File tree

6 files changed

+96
-3
lines changed

6 files changed

+96
-3
lines changed

cuda_bindings/cuda/bindings/driver.pyx.in

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import cython
88
import ctypes
99
from libc.stdlib cimport calloc, malloc, free
1010
from libc cimport string
11-
from libc.stdint cimport int32_t, uint32_t, int64_t, uint64_t
11+
from libc.stdint cimport int32_t, uint32_t, int64_t, uint64_t, uintptr_t
1212
from libc.stddef cimport wchar_t
1313
from libc.limits cimport CHAR_MIN
1414
from libcpp.vector cimport vector
@@ -6529,6 +6529,8 @@ cdef class CUcontext:
65296529
if not isinstance(other, CUcontext):
65306530
return False
65316531
return self._pvt_ptr[0] == (<CUcontext>other)._pvt_ptr[0]
6532+
def __hash__(self):
6533+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
65326534
def __int__(self):
65336535
return <void_ptr>self._pvt_ptr[0]
65346536
def getPtr(self):
@@ -6564,6 +6566,8 @@ cdef class CUmodule:
65646566
if not isinstance(other, CUmodule):
65656567
return False
65666568
return self._pvt_ptr[0] == (<CUmodule>other)._pvt_ptr[0]
6569+
def __hash__(self):
6570+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
65676571
def __int__(self):
65686572
return <void_ptr>self._pvt_ptr[0]
65696573
def getPtr(self):
@@ -6599,6 +6603,8 @@ cdef class CUfunction:
65996603
if not isinstance(other, CUfunction):
66006604
return False
66016605
return self._pvt_ptr[0] == (<CUfunction>other)._pvt_ptr[0]
6606+
def __hash__(self):
6607+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
66026608
def __int__(self):
66036609
return <void_ptr>self._pvt_ptr[0]
66046610
def getPtr(self):
@@ -6634,6 +6640,8 @@ cdef class CUlibrary:
66346640
if not isinstance(other, CUlibrary):
66356641
return False
66366642
return self._pvt_ptr[0] == (<CUlibrary>other)._pvt_ptr[0]
6643+
def __hash__(self):
6644+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
66376645
def __int__(self):
66386646
return <void_ptr>self._pvt_ptr[0]
66396647
def getPtr(self):
@@ -6669,6 +6677,8 @@ cdef class CUkernel:
66696677
if not isinstance(other, CUkernel):
66706678
return False
66716679
return self._pvt_ptr[0] == (<CUkernel>other)._pvt_ptr[0]
6680+
def __hash__(self):
6681+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
66726682
def __int__(self):
66736683
return <void_ptr>self._pvt_ptr[0]
66746684
def getPtr(self):
@@ -6704,6 +6714,8 @@ cdef class CUarray:
67046714
if not isinstance(other, CUarray):
67056715
return False
67066716
return self._pvt_ptr[0] == (<CUarray>other)._pvt_ptr[0]
6717+
def __hash__(self):
6718+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
67076719
def __int__(self):
67086720
return <void_ptr>self._pvt_ptr[0]
67096721
def getPtr(self):
@@ -6739,6 +6751,8 @@ cdef class CUmipmappedArray:
67396751
if not isinstance(other, CUmipmappedArray):
67406752
return False
67416753
return self._pvt_ptr[0] == (<CUmipmappedArray>other)._pvt_ptr[0]
6754+
def __hash__(self):
6755+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
67426756
def __int__(self):
67436757
return <void_ptr>self._pvt_ptr[0]
67446758
def getPtr(self):
@@ -6774,6 +6788,8 @@ cdef class CUtexref:
67746788
if not isinstance(other, CUtexref):
67756789
return False
67766790
return self._pvt_ptr[0] == (<CUtexref>other)._pvt_ptr[0]
6791+
def __hash__(self):
6792+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
67776793
def __int__(self):
67786794
return <void_ptr>self._pvt_ptr[0]
67796795
def getPtr(self):
@@ -6809,6 +6825,8 @@ cdef class CUsurfref:
68096825
if not isinstance(other, CUsurfref):
68106826
return False
68116827
return self._pvt_ptr[0] == (<CUsurfref>other)._pvt_ptr[0]
6828+
def __hash__(self):
6829+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
68126830
def __int__(self):
68136831
return <void_ptr>self._pvt_ptr[0]
68146832
def getPtr(self):
@@ -6844,6 +6862,8 @@ cdef class CUevent:
68446862
if not isinstance(other, CUevent):
68456863
return False
68466864
return self._pvt_ptr[0] == (<CUevent>other)._pvt_ptr[0]
6865+
def __hash__(self):
6866+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
68476867
def __int__(self):
68486868
return <void_ptr>self._pvt_ptr[0]
68496869
def getPtr(self):
@@ -6879,6 +6899,8 @@ cdef class CUstream:
68796899
if not isinstance(other, CUstream):
68806900
return False
68816901
return self._pvt_ptr[0] == (<CUstream>other)._pvt_ptr[0]
6902+
def __hash__(self):
6903+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
68826904
def __int__(self):
68836905
return <void_ptr>self._pvt_ptr[0]
68846906
def getPtr(self):
@@ -6914,6 +6936,8 @@ cdef class CUgraphicsResource:
69146936
if not isinstance(other, CUgraphicsResource):
69156937
return False
69166938
return self._pvt_ptr[0] == (<CUgraphicsResource>other)._pvt_ptr[0]
6939+
def __hash__(self):
6940+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
69176941
def __int__(self):
69186942
return <void_ptr>self._pvt_ptr[0]
69196943
def getPtr(self):
@@ -6949,6 +6973,8 @@ cdef class CUexternalMemory:
69496973
if not isinstance(other, CUexternalMemory):
69506974
return False
69516975
return self._pvt_ptr[0] == (<CUexternalMemory>other)._pvt_ptr[0]
6976+
def __hash__(self):
6977+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
69526978
def __int__(self):
69536979
return <void_ptr>self._pvt_ptr[0]
69546980
def getPtr(self):
@@ -6984,6 +7010,8 @@ cdef class CUexternalSemaphore:
69847010
if not isinstance(other, CUexternalSemaphore):
69857011
return False
69867012
return self._pvt_ptr[0] == (<CUexternalSemaphore>other)._pvt_ptr[0]
7013+
def __hash__(self):
7014+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
69877015
def __int__(self):
69887016
return <void_ptr>self._pvt_ptr[0]
69897017
def getPtr(self):
@@ -7019,6 +7047,8 @@ cdef class CUgraph:
70197047
if not isinstance(other, CUgraph):
70207048
return False
70217049
return self._pvt_ptr[0] == (<CUgraph>other)._pvt_ptr[0]
7050+
def __hash__(self):
7051+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
70227052
def __int__(self):
70237053
return <void_ptr>self._pvt_ptr[0]
70247054
def getPtr(self):
@@ -7054,6 +7084,8 @@ cdef class CUgraphNode:
70547084
if not isinstance(other, CUgraphNode):
70557085
return False
70567086
return self._pvt_ptr[0] == (<CUgraphNode>other)._pvt_ptr[0]
7087+
def __hash__(self):
7088+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
70577089
def __int__(self):
70587090
return <void_ptr>self._pvt_ptr[0]
70597091
def getPtr(self):
@@ -7089,6 +7121,8 @@ cdef class CUgraphExec:
70897121
if not isinstance(other, CUgraphExec):
70907122
return False
70917123
return self._pvt_ptr[0] == (<CUgraphExec>other)._pvt_ptr[0]
7124+
def __hash__(self):
7125+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
70927126
def __int__(self):
70937127
return <void_ptr>self._pvt_ptr[0]
70947128
def getPtr(self):
@@ -7124,6 +7158,8 @@ cdef class CUmemoryPool:
71247158
if not isinstance(other, CUmemoryPool):
71257159
return False
71267160
return self._pvt_ptr[0] == (<CUmemoryPool>other)._pvt_ptr[0]
7161+
def __hash__(self):
7162+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
71277163
def __int__(self):
71287164
return <void_ptr>self._pvt_ptr[0]
71297165
def getPtr(self):
@@ -7159,6 +7195,8 @@ cdef class CUuserObject:
71597195
if not isinstance(other, CUuserObject):
71607196
return False
71617197
return self._pvt_ptr[0] == (<CUuserObject>other)._pvt_ptr[0]
7198+
def __hash__(self):
7199+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
71627200
def __int__(self):
71637201
return <void_ptr>self._pvt_ptr[0]
71647202
def getPtr(self):
@@ -7194,6 +7232,8 @@ cdef class CUgraphDeviceNode:
71947232
if not isinstance(other, CUgraphDeviceNode):
71957233
return False
71967234
return self._pvt_ptr[0] == (<CUgraphDeviceNode>other)._pvt_ptr[0]
7235+
def __hash__(self):
7236+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
71977237
def __int__(self):
71987238
return <void_ptr>self._pvt_ptr[0]
71997239
def getPtr(self):
@@ -7229,6 +7269,8 @@ cdef class CUasyncCallbackHandle:
72297269
if not isinstance(other, CUasyncCallbackHandle):
72307270
return False
72317271
return self._pvt_ptr[0] == (<CUasyncCallbackHandle>other)._pvt_ptr[0]
7272+
def __hash__(self):
7273+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
72327274
def __int__(self):
72337275
return <void_ptr>self._pvt_ptr[0]
72347276
def getPtr(self):
@@ -7264,6 +7306,8 @@ cdef class CUgreenCtx:
72647306
if not isinstance(other, CUgreenCtx):
72657307
return False
72667308
return self._pvt_ptr[0] == (<CUgreenCtx>other)._pvt_ptr[0]
7309+
def __hash__(self):
7310+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
72677311
def __int__(self):
72687312
return <void_ptr>self._pvt_ptr[0]
72697313
def getPtr(self):
@@ -7297,6 +7341,8 @@ cdef class CUlinkState:
72977341
if not isinstance(other, CUlinkState):
72987342
return False
72997343
return self._pvt_ptr[0] == (<CUlinkState>other)._pvt_ptr[0]
7344+
def __hash__(self):
7345+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
73007346
def __int__(self):
73017347
return <void_ptr>self._pvt_ptr[0]
73027348
def getPtr(self):
@@ -7332,6 +7378,8 @@ cdef class CUdevResourceDesc:
73327378
if not isinstance(other, CUdevResourceDesc):
73337379
return False
73347380
return self._pvt_ptr[0] == (<CUdevResourceDesc>other)._pvt_ptr[0]
7381+
def __hash__(self):
7382+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
73357383
def __int__(self):
73367384
return <void_ptr>self._pvt_ptr[0]
73377385
def getPtr(self):
@@ -7365,6 +7413,8 @@ cdef class CUlogsCallbackHandle:
73657413
if not isinstance(other, CUlogsCallbackHandle):
73667414
return False
73677415
return self._pvt_ptr[0] == (<CUlogsCallbackHandle>other)._pvt_ptr[0]
7416+
def __hash__(self):
7417+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
73687418
def __int__(self):
73697419
return <void_ptr>self._pvt_ptr[0]
73707420
def getPtr(self):
@@ -7400,6 +7450,8 @@ cdef class CUeglStreamConnection:
74007450
if not isinstance(other, CUeglStreamConnection):
74017451
return False
74027452
return self._pvt_ptr[0] == (<CUeglStreamConnection>other)._pvt_ptr[0]
7453+
def __hash__(self):
7454+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
74037455
def __int__(self):
74047456
return <void_ptr>self._pvt_ptr[0]
74057457
def getPtr(self):
@@ -7433,6 +7485,8 @@ cdef class EGLImageKHR:
74337485
if not isinstance(other, EGLImageKHR):
74347486
return False
74357487
return self._pvt_ptr[0] == (<EGLImageKHR>other)._pvt_ptr[0]
7488+
def __hash__(self):
7489+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
74367490
def __int__(self):
74377491
return <void_ptr>self._pvt_ptr[0]
74387492
def getPtr(self):
@@ -7466,6 +7520,8 @@ cdef class EGLStreamKHR:
74667520
if not isinstance(other, EGLStreamKHR):
74677521
return False
74687522
return self._pvt_ptr[0] == (<EGLStreamKHR>other)._pvt_ptr[0]
7523+
def __hash__(self):
7524+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
74697525
def __int__(self):
74707526
return <void_ptr>self._pvt_ptr[0]
74717527
def getPtr(self):
@@ -7499,6 +7555,8 @@ cdef class EGLSyncKHR:
74997555
if not isinstance(other, EGLSyncKHR):
75007556
return False
75017557
return self._pvt_ptr[0] == (<EGLSyncKHR>other)._pvt_ptr[0]
7558+
def __hash__(self):
7559+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
75027560
def __int__(self):
75037561
return <void_ptr>self._pvt_ptr[0]
75047562
def getPtr(self):

cuda_bindings/cuda/bindings/nvrtc.pyx.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import cython
88
import ctypes
99
from libc.stdlib cimport calloc, malloc, free
1010
from libc cimport string
11-
from libc.stdint cimport int32_t, uint32_t, int64_t, uint64_t
11+
from libc.stdint cimport int32_t, uint32_t, int64_t, uint64_t, uintptr_t
1212
from libc.stddef cimport wchar_t
1313
from libc.limits cimport CHAR_MIN
1414
from libcpp.vector cimport vector
@@ -113,6 +113,8 @@ cdef class nvrtcProgram:
113113
if not isinstance(other, nvrtcProgram):
114114
return False
115115
return self._pvt_ptr[0] == (<nvrtcProgram>other)._pvt_ptr[0]
116+
def __hash__(self):
117+
return hash(<uintptr_t><void*>(self._pvt_ptr[0]))
116118
def __int__(self):
117119
return <void_ptr>self._pvt_ptr[0]
118120
def getPtr(self):

0 commit comments

Comments
 (0)