Skip to content

Commit 1f94e7f

Browse files
committed
type->dtype in LocalAccessor initialization
Fixes conflict with built-in `type`
1 parent c849993 commit 1f94e7f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

dpctl/_sycl_queue.pyx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,36 +129,36 @@ cdef class kernel_arg_type_attribute:
129129
cdef class LocalAccessor:
130130
cdef _md_local_accessor lacc
131131

132-
def __cinit__(self, size_t ndim, str type, size_t dim0, size_t dim1, size_t dim2):
132+
def __cinit__(self, size_t ndim, str dtype, size_t dim0, size_t dim1, size_t dim2):
133133
self.lacc.ndim = ndim
134134
self.lacc.dim0 = dim0
135135
self.lacc.dim1 = dim1
136136
self.lacc.dim2 = dim2
137137

138138
if ndim < 1 or ndim > 3:
139139
raise ValueError
140-
if type == 'i1':
140+
if dtype == 'i1':
141141
self.lacc.dpctl_type_id = _arg_data_type._INT8_T
142-
elif type == 'u1':
142+
elif dtype == 'u1':
143143
self.lacc.dpctl_type_id = _arg_data_type._UINT8_T
144-
elif type == 'i2':
144+
elif dtype == 'i2':
145145
self.lacc.dpctl_type_id = _arg_data_type._INT16_T
146-
elif type == 'u2':
146+
elif dtype == 'u2':
147147
self.lacc.dpctl_type_id = _arg_data_type._UINT16_T
148-
elif type == 'i4':
148+
elif dtype == 'i4':
149149
self.lacc.dpctl_type_id = _arg_data_type._INT32_T
150-
elif type == 'u4':
150+
elif dtype == 'u4':
151151
self.lacc.dpctl_type_id = _arg_data_type._UINT32_T
152-
elif type == 'i8':
152+
elif dtype == 'i8':
153153
self.lacc.dpctl_type_id = _arg_data_type._INT64_T
154-
elif type == 'u8':
154+
elif dtype == 'u8':
155155
self.lacc.dpctl_type_id = _arg_data_type._UINT64_T
156-
elif type == 'f4':
156+
elif dtype == 'f4':
157157
self.lacc.dpctl_type_id = _arg_data_type._FLOAT
158-
elif type == 'f8':
158+
elif dtype == 'f8':
159159
self.lacc.dpctl_type_id = _arg_data_type._DOUBLE
160160
else:
161-
raise ValueError(f"Unrecognized type value: '{type}'")
161+
raise ValueError(f"Unrecognized type value: '{dtype}'")
162162

163163
def __repr__(self):
164164
return "LocalAccessor(" + self.ndim + ")"

0 commit comments

Comments
 (0)