@@ -144,12 +144,12 @@ struct StridedIndexer
144
144
{
145
145
}
146
146
147
- size_t operator ()(py::ssize_t gid) const
147
+ py:: ssize_t operator ()(py::ssize_t gid) const
148
148
{
149
149
return compute_offset (gid);
150
150
}
151
151
152
- size_t operator ()(size_t gid) const
152
+ py:: ssize_t operator ()(size_t gid) const
153
153
{
154
154
return compute_offset (static_cast <py::ssize_t >(gid));
155
155
}
@@ -159,7 +159,7 @@ struct StridedIndexer
159
159
py::ssize_t starting_offset;
160
160
py::ssize_t const *shape_strides;
161
161
162
- size_t compute_offset (py::ssize_t gid) const
162
+ py:: ssize_t compute_offset (py::ssize_t gid) const
163
163
{
164
164
using dpctl::tensor::strides::CIndexer_vector;
165
165
@@ -185,12 +185,12 @@ struct UnpackedStridedIndexer
185
185
{
186
186
}
187
187
188
- size_t operator ()(py::ssize_t gid) const
188
+ py:: ssize_t operator ()(py::ssize_t gid) const
189
189
{
190
190
return compute_offset (gid);
191
191
}
192
192
193
- size_t operator ()(size_t gid) const
193
+ py:: ssize_t operator ()(size_t gid) const
194
194
{
195
195
return compute_offset (static_cast <py::ssize_t >(gid));
196
196
}
@@ -201,7 +201,7 @@ struct UnpackedStridedIndexer
201
201
py::ssize_t const *shape;
202
202
py::ssize_t const *strides;
203
203
204
- size_t compute_offset (py::ssize_t gid) const
204
+ py:: ssize_t compute_offset (py::ssize_t gid) const
205
205
{
206
206
using dpctl::tensor::strides::CIndexer_vector;
207
207
@@ -223,11 +223,10 @@ struct Strided1DIndexer
223
223
{
224
224
}
225
225
226
- size_t operator ()(size_t gid) const
226
+ py:: ssize_t operator ()(size_t gid) const
227
227
{
228
228
// ensure 0 <= gid < size
229
- return static_cast <size_t >(offset +
230
- std::min<size_t >(gid, size - 1 ) * step);
229
+ return offset + std::min<size_t >(gid, size - 1 ) * step;
231
230
}
232
231
233
232
private:
@@ -245,9 +244,9 @@ struct Strided1DCyclicIndexer
245
244
{
246
245
}
247
246
248
- size_t operator ()(size_t gid) const
247
+ py:: ssize_t operator ()(size_t gid) const
249
248
{
250
- return static_cast < size_t >( offset + (gid % size) * step) ;
249
+ return offset + (gid % size) * step;
251
250
}
252
251
253
252
private:
0 commit comments