Skip to content

Commit de3c856

Browse files
Fixed signature of SyclDevice._init_helper (#347)
Added missing "return 0" in other _init_* method with return type of `int`
1 parent 1ee0521 commit de3c856

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

dpctl/_sycl_device.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ cdef class SyclDevice(_SyclDevice):
4040
@staticmethod
4141
cdef SyclDevice _create(DPCTLSyclDeviceRef dref)
4242
@staticmethod
43-
cdef void _init_helper(SyclDevice device, DPCTLSyclDeviceRef DRef)
43+
cdef void _init_helper(_SyclDevice device, DPCTLSyclDeviceRef DRef)
4444
cdef int _init_from__SyclDevice(self, _SyclDevice other)
4545
cdef int _init_from_selector(self, DPCTLSyclDeviceSelectorRef DSRef)
4646
cdef DPCTLSyclDeviceRef get_device_ref(self)

dpctl/_sycl_device.pyx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ cdef class SyclDevice(_SyclDevice):
123123
124124
"""
125125
@staticmethod
126-
cdef void _init_helper(SyclDevice device, DPCTLSyclDeviceRef DRef):
126+
cdef void _init_helper(_SyclDevice device, DPCTLSyclDeviceRef DRef):
127127
device._device_ref = DRef
128128
device._device_name = DPCTLDevice_GetName(DRef)
129129
device._driver_version = DPCTLDevice_GetDriverInfo(DRef)
@@ -132,9 +132,9 @@ cdef class SyclDevice(_SyclDevice):
132132

133133
@staticmethod
134134
cdef SyclDevice _create(DPCTLSyclDeviceRef dref):
135-
cdef SyclDevice ret = <SyclDevice>_SyclDevice.__new__(_SyclDevice)
135+
cdef _SyclDevice ret = _SyclDevice.__new__(_SyclDevice)
136136
# Initialize the attributes of the SyclDevice object
137-
SyclDevice._init_helper(ret, dref)
137+
SyclDevice._init_helper(<_SyclDevice> ret, dref)
138138
return SyclDevice(ret)
139139

140140
cdef int _init_from__SyclDevice(self, _SyclDevice other):
@@ -147,6 +147,7 @@ cdef class SyclDevice(_SyclDevice):
147147
DPCTLDevice_GetMaxWorkItemSizes(self._device_ref)
148148
)
149149
self._vendor_name = DPCTLDevice_GetVendorName(self._device_ref)
150+
return 0
150151

151152
cdef int _init_from_selector(self, DPCTLSyclDeviceSelectorRef DSRef):
152153
# Initialize the attributes of the SyclDevice object
@@ -221,7 +222,7 @@ cdef class SyclDevice(_SyclDevice):
221222
int: The address of the DPCTLSyclDeviceRef object used to create
222223
this SyclDevice cast to a size_t.
223224
"""
224-
return int(<size_t>self._device_ref)
225+
return <size_t>self._device_ref
225226

226227
@property
227228
def backend(self):

0 commit comments

Comments
 (0)