Skip to content

Commit cc201c3

Browse files
Filled empty strings in lookup typenum -> str, and typenum->itemsiz
'i4' translates to typenum 5 on Linux, but to typenum 7 on Windows, and this entry in the look-up array was not meaningfully populated
1 parent 3fe2570 commit cc201c3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dpctl/tensor/_types.pxi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ cdef str _make_typestr(int typenum):
4141
Make typestring from type number
4242
"""
4343
cdef type_to_str = ['|b1', '|i1', '|u1', '|i2', '|u2',
44-
'|i4', '|u4', '', '', '|i8', '|u8',
44+
'|i4', '|u4', '|i4', '|u4', '|i8', '|u8',
4545
'|f4', '|f8', '', '|c8', '|c16', '']
4646

4747
if (typenum < 0):
@@ -63,8 +63,8 @@ cdef int type_bytesize(int typenum):
6363
NPY_USHORT=4 : 2
6464
NPY_INT=5 : 4
6565
NPY_UINT=6 : 4
66-
NPY_LONG=7 :
67-
NPY_ULONG=8 :
66+
NPY_LONG=7 : 4
67+
NPY_ULONG=8 : 4
6868
NPY_LONGLONG=9 : 8
6969
NPY_ULONGLONG=10 : 8
7070
NPY_FLOAT=11 : 4
@@ -76,7 +76,7 @@ cdef int type_bytesize(int typenum):
7676
NPY_HALF=23 : 2
7777
"""
7878
cdef int *type_to_bytesize = [
79-
1, 1, 1, 2, 2, 4, 4, 8, 8, 8, 8, 4, 8, -1, 8, 16, -1]
79+
1, 1, 1, 2, 2, 4, 4, 4, 4, 8, 8, 4, 8, -1, 8, 16, -1]
8080

8181
if typenum < 0:
8282
return -1

0 commit comments

Comments
 (0)