Skip to content

Commit dd4c0c0

Browse files
committed
Minor change to _is_kdlcpu_device
Better fits Cython style by using array-index-access to explicitly dereference pointer rather than relying on Cython to implicitly dereference it in code generation
1 parent 4c360d3 commit dd4c0c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dpctl/tensor/_dlpack.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ class _numpy_array_interface_wrapper:
720720

721721
cdef bint _is_kdlcpu_device(DLDevice *dev):
722722
"Check if DLTensor.DLDevice denotes (kDLCPU, 0)"
723-
return (dev.device_type == kDLCPU) and (dev.device_id == 0)
723+
return (dev[0].device_type == kDLCPU) and (dev[0].device_id == 0)
724724

725725

726726
cpdef object from_dlpack_capsule(object py_caps):

0 commit comments

Comments
 (0)