File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
dpctl/tensor/libtensor/include/utils Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -228,9 +228,22 @@ struct usm_ndarray_types
228
228
else if (typenum == UAR_HALF_) {
229
229
return static_cast <int >(typenum_t ::HALF);
230
230
}
231
+ else if (typenum == UAR_INT || typenum == UAR_UINT) {
232
+ switch (sizeof (int )) {
233
+ case sizeof (std::int32_t ):
234
+ return ((typenum == UAR_INT)
235
+ ? static_cast <int >(typenum_t ::INT32)
236
+ : static_cast <int >(typenum_t ::UINT32));
237
+ case sizeof (std::int64_t ):
238
+ return ((typenum == UAR_INT)
239
+ ? static_cast <int >(typenum_t ::INT64)
240
+ : static_cast <int >(typenum_t ::UINT64));
241
+ default :
242
+ throw_unrecognized_typenum_error (typenum);
243
+ }
244
+ }
231
245
else {
232
- throw std::runtime_error (" Unrecogized typenum " +
233
- std::to_string (typenum) + " encountered." );
246
+ throw_unrecognized_typenum_error (typenum);
234
247
}
235
248
}
236
249
@@ -286,6 +299,12 @@ struct usm_ndarray_types
286
299
287
300
return types;
288
301
}
302
+
303
+ void throw_unrecognized_typenum_error (int typenum)
304
+ {
305
+ throw std::runtime_error (" Unrecogized typenum " +
306
+ std::to_string (typenum) + " encountered." );
307
+ }
289
308
};
290
309
291
310
} // namespace detail
You can’t perform that action at this time.
0 commit comments