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
223223 throw_unrecognized_typenum_error (typenum);
224224 }
225225 }
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+ }
226237 else {
227238 throw_unrecognized_typenum_error (typenum);
228239 }
@@ -234,7 +245,7 @@ struct usm_ndarray_types
234245private:
235246 void throw_unrecognized_typenum_error (int typenum) const
236247 {
237- throw std::runtime_error (" Unrecogized typenum " +
248+ throw std::runtime_error (" Unrecognized typenum " +
238249 std::to_string (typenum) + " encountered." );
239250 }
240251};
Original file line number Diff line number Diff line change @@ -355,3 +355,11 @@ def test_asarray_seq_of_arrays_on_different_queues():
355355
356356 with pytest .raises (dpctl .utils .ExecutionPlacementError ):
357357 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