File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
tensor/libtensor/include/utils Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,17 @@ struct usm_ndarray_types
223
223
throw_unrecognized_typenum_error (typenum);
224
224
}
225
225
}
226
+ else if (typenum == api.UAR_LONGLONG_ || typenum == api.UAR_ULONGLONG_ )
227
+ {
228
+ switch (sizeof (long long )) {
229
+ case sizeof (std::int64_t ):
230
+ return ((typenum == api.UAR_LONGLONG_ )
231
+ ? static_cast <int >(typenum_t ::INT64)
232
+ : static_cast <int >(typenum_t ::UINT64));
233
+ default :
234
+ throw_unrecognized_typenum_error (typenum);
235
+ }
236
+ }
226
237
else {
227
238
throw_unrecognized_typenum_error (typenum);
228
239
}
@@ -234,7 +245,7 @@ struct usm_ndarray_types
234
245
private:
235
246
void throw_unrecognized_typenum_error (int typenum) const
236
247
{
237
- throw std::runtime_error (" Unrecogized typenum " +
248
+ throw std::runtime_error (" Unrecognized typenum " +
238
249
std::to_string (typenum) + " encountered." );
239
250
}
240
251
};
Original file line number Diff line number Diff line change @@ -355,3 +355,11 @@ def test_asarray_seq_of_arrays_on_different_queues():
355
355
356
356
with pytest .raises (dpctl .utils .ExecutionPlacementError ):
357
357
dpt .asarray ([m , [w , py_seq ]])
358
+
359
+
360
+ def test_ulonglong_gh_1167 ():
361
+ get_queue_or_skip ()
362
+ x = dpt .asarray (9223372036854775807 , dtype = "u8" )
363
+ assert x .dtype == dpt .uint64
364
+ x = dpt .asarray (9223372036854775808 , dtype = "u8" )
365
+ assert x .dtype == dpt .uint64
You can’t perform that action at this time.
0 commit comments