Skip to content

Fixed signature of SyclDevice._init_helper #347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dpctl/_sycl_device.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cdef class SyclDevice(_SyclDevice):
@staticmethod
cdef SyclDevice _create(DPCTLSyclDeviceRef dref)
@staticmethod
cdef void _init_helper(SyclDevice device, DPCTLSyclDeviceRef DRef)
cdef void _init_helper(_SyclDevice device, DPCTLSyclDeviceRef DRef)
cdef int _init_from__SyclDevice(self, _SyclDevice other)
cdef int _init_from_selector(self, DPCTLSyclDeviceSelectorRef DSRef)
cdef DPCTLSyclDeviceRef get_device_ref(self)
9 changes: 5 additions & 4 deletions dpctl/_sycl_device.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ cdef class SyclDevice(_SyclDevice):

"""
@staticmethod
cdef void _init_helper(SyclDevice device, DPCTLSyclDeviceRef DRef):
cdef void _init_helper(_SyclDevice device, DPCTLSyclDeviceRef DRef):
device._device_ref = DRef
device._device_name = DPCTLDevice_GetName(DRef)
device._driver_version = DPCTLDevice_GetDriverInfo(DRef)
Expand All @@ -132,9 +132,9 @@ cdef class SyclDevice(_SyclDevice):

@staticmethod
cdef SyclDevice _create(DPCTLSyclDeviceRef dref):
cdef SyclDevice ret = <SyclDevice>_SyclDevice.__new__(_SyclDevice)
cdef _SyclDevice ret = _SyclDevice.__new__(_SyclDevice)
# Initialize the attributes of the SyclDevice object
SyclDevice._init_helper(ret, dref)
SyclDevice._init_helper(<_SyclDevice> ret, dref)
return SyclDevice(ret)

cdef int _init_from__SyclDevice(self, _SyclDevice other):
Expand All @@ -147,6 +147,7 @@ cdef class SyclDevice(_SyclDevice):
DPCTLDevice_GetMaxWorkItemSizes(self._device_ref)
)
self._vendor_name = DPCTLDevice_GetVendorName(self._device_ref)
return 0

cdef int _init_from_selector(self, DPCTLSyclDeviceSelectorRef DSRef):
# Initialize the attributes of the SyclDevice object
Expand Down Expand Up @@ -221,7 +222,7 @@ cdef class SyclDevice(_SyclDevice):
int: The address of the DPCTLSyclDeviceRef object used to create
this SyclDevice cast to a size_t.
"""
return int(<size_t>self._device_ref)
return <size_t>self._device_ref

@property
def backend(self):
Expand Down