@@ -176,3 +176,51 @@ def test_array_api_inspection_dtype_kind():
176176 )
177177 == info .dtypes ()
178178 )
179+ assert info .dtypes (
180+ kind = ("integral" , "real floating" , "complex floating" )
181+ ) == info .dtypes (kind = "numeric" )
182+
183+
184+ def test_array_api_inspection_dtype_kind_errors ():
185+ info = dpt .__array_namespace_info__ ()
186+ try :
187+ info .default_device ()
188+ except dpctl .SyclDeviceCreationError :
189+ pytest .skip ("No default device available" )
190+
191+ with pytest .raises (ValueError ):
192+ info .dtypes (kind = "error" )
193+
194+ with pytest .raises (TypeError ):
195+ info .dtypes (kind = {0 : "real floating" })
196+
197+
198+ def test_array_api_inspection_device_types ():
199+ info = dpt .__array_namespace_info__ ()
200+ try :
201+ dev = info .default_device ()
202+ except dpctl .SyclDeviceCreationError :
203+ pytest .skip ("No default device available" )
204+
205+ q = dpctl .SyclQueue (dev )
206+ assert info .default_dtypes (device = q )
207+ assert info .dtypes (device = q )
208+
209+ dev_dpt = dpt .Device .create_device (dev )
210+ assert info .default_dtypes (device = dev_dpt )
211+ assert info .dtypes (device = dev_dpt )
212+
213+ filter = dev .get_filter_string ()
214+ assert info .default_dtypes (device = filter )
215+ assert info .dtypes (device = filter )
216+
217+
218+ def test_array_api_inspection_device_errors ():
219+ info = dpt .__array_namespace_info__ ()
220+
221+ bad_dev = dict ()
222+ with pytest .raises (TypeError ):
223+ info .dtypes (device = bad_dev )
224+
225+ with pytest .raises (TypeError ):
226+ info .default_dtypes (device = bad_dev )
0 commit comments