@@ -127,6 +127,41 @@ cdef class kernel_arg_type_attribute:
127
127
128
128
129
129
cdef class LocalAccessor:
130
+ """
131
+ LocalAccessor(ndim, dtype, dim0, dim1, dim2)
132
+
133
+ Python class for specifying the dimensionality and type of a
134
+ ``sycl::local_accessor``, to be used as a kernel argument type.
135
+
136
+ Args:
137
+ ndim (size_t):
138
+ number of dimensions.
139
+ Can be between one and three.
140
+ dtype (str):
141
+ the data type of the local memory.
142
+ The permitted values are
143
+
144
+ `'i1'`, `'i2'`, `'i4'`, `'i8'`:
145
+ signed integral types int8_t, int16_t, int32_t, int64_t
146
+ `'u1'`, `'u2'`, `'u4'`, `'u8'`
147
+ unsigned integral types uint8_t, uint16_t, uint32_t,
148
+ uint64_t
149
+ `'f4'`, `'f8'`,
150
+ single- and double-precision floating-point types float and
151
+ double
152
+ dim0 (size_t):
153
+ Size of the first dimension.
154
+ dim1 (size_t):
155
+ Size of the second dimension.
156
+ dim2 (size_t):
157
+ Size of the third dimension.
158
+
159
+ Raises:
160
+ ValueError:
161
+ If the given dimension is not between one and three.
162
+ ValueError:
163
+ If the dtype string is unrecognized.
164
+ """
130
165
cdef _md_local_accessor lacc
131
166
132
167
def __cinit__ (self , size_t ndim , str dtype , size_t dim0 , size_t dim1 , size_t dim2 ):
@@ -136,7 +171,7 @@ cdef class LocalAccessor:
136
171
self .lacc.dim2 = dim2
137
172
138
173
if ndim < 1 or ndim > 3 :
139
- raise ValueError
174
+ raise ValueError ( " LocalAccessor must have dimension between one and three " )
140
175
if dtype == ' i1' :
141
176
self .lacc.dpctl_type_id = _arg_data_type._INT8_T
142
177
elif dtype == ' u1' :
@@ -164,6 +199,10 @@ cdef class LocalAccessor:
164
199
return " LocalAccessor(" + self .ndim + " )"
165
200
166
201
cdef size_t addressof(self ):
202
+ """
203
+ Returns the address of the _md_local_accessor for this LocalAccessor
204
+ cast to ``size_t``.
205
+ """
167
206
return < size_t> & self .lacc
168
207
169
208
0 commit comments