Skip to content

Commit c6f4485

Browse files
committed
type->dtype in LocalAccessor initialization
Fixes conflict with built-in `type`
1 parent 6fbcdb7 commit c6f4485

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

dpctl/_sycl_queue.pyx

+12-12
Original file line numberDiff line numberDiff line change
@@ -125,36 +125,36 @@ cdef class kernel_arg_type_attribute:
125125
cdef class LocalAccessor:
126126
cdef _md_local_accessor lacc
127127

128-
def __cinit__(self, size_t ndim, str type, size_t dim0, size_t dim1, size_t dim2):
128+
def __cinit__(self, size_t ndim, str dtype, size_t dim0, size_t dim1, size_t dim2):
129129
self.lacc.ndim = ndim
130130
self.lacc.dim0 = dim0
131131
self.lacc.dim1 = dim1
132132
self.lacc.dim2 = dim2
133133

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

159159
def __repr__(self):
160160
return "LocalAccessor(" + self.ndim + ")"

0 commit comments

Comments
 (0)