@@ -27,9 +27,7 @@ def _assert_shape(a, b):
2727
2828
2929def _get_dev_mask (device = None ):
30- dev = dpctl .select_default_device () if device is None else device
31- dev_info = dpctl .utils .intel_device_info (dev )
32- return dev_info .get ("device_id" , 0 ) & 0xFF00
30+ return get_dev_id (device ) & 0xFF00
3331
3432
3533def assert_dtype_allclose (
@@ -110,6 +108,19 @@ def assert_dtype_allclose(
110108 _assert_dtype (dpnp_arr .dtype , numpy_arr .dtype , check_only_type_kind )
111109
112110
111+ def factor_to_tol (dtype , factor ):
112+ """
113+ Calculate the tolerance for comparing floating point and complex arrays.
114+ The tolerance is based on the maximum resolution of the input dtype multiplied by the factor.
115+ """
116+
117+ tol = 0
118+ if numpy .issubdtype (dtype , numpy .inexact ):
119+ tol = numpy .finfo (dtype ).resolution
120+
121+ return factor * tol
122+
123+
113124def generate_random_numpy_array (
114125 shape ,
115126 dtype = None ,
@@ -208,19 +219,6 @@ def generate_random_numpy_array(
208219 return a
209220
210221
211- def factor_to_tol (dtype , factor ):
212- """
213- Calculate the tolerance for comparing floating point and complex arrays.
214- The tolerance is based on the maximum resolution of the input dtype multiplied by the factor.
215- """
216-
217- tol = 0
218- if numpy .issubdtype (dtype , numpy .inexact ):
219- tol = numpy .finfo (dtype ).resolution
220-
221- return factor * tol
222-
223-
224222def get_abs_array (data , dtype = None ):
225223 if numpy .issubdtype (dtype , numpy .unsignedinteger ):
226224 data = numpy .abs (data )
@@ -305,6 +303,16 @@ def get_complex_dtypes(device=None):
305303 return dtypes
306304
307305
306+ def get_dev_id (device = None ):
307+ """
308+ Obtain Intel Device ID for a device (the default device if not provided).
309+ """
310+
311+ dev = dpctl .select_default_device () if device is None else device
312+ dev_info = dpctl .utils .intel_device_info (dev )
313+ return dev_info .get ("device_id" , 0 )
314+
315+
308316def get_float_dtypes (no_float16 = True , device = None ):
309317 """
310318 Build a list of floating types supported by DPNP based on device capabilities.
@@ -456,11 +464,11 @@ def is_intel_numpy():
456464 return all (dep ["name" ].startswith ("mkl" ) for dep in [blas , lapack ])
457465
458466
459- def is_iris_xe (device = None ):
467+ def is_lnl (device = None ):
460468 """
461- Return True if a test is running on Iris Xe GPU device, False otherwise.
469+ Return True if a test is running on Lunar Lake GPU device, False otherwise.
462470 """
463- return _get_dev_mask (device ) == 0x9A00
471+ return _get_dev_mask (device ) == 0x6400
464472
465473
466474def is_lts_driver (device = None ):
@@ -474,10 +482,18 @@ def is_lts_driver(device=None):
474482
475483def is_ptl (device = None ):
476484 """
477- Return True if a test is running on Panther Lake with Iris Xe3 GPU device,
485+ Return True if a test is running on Panther Lake with Iris Xe3 GPU device
486+ (which includes PTL-U, PTL-H and WCL), False otherwise.
487+ """
488+ return _get_dev_mask (device ) in (0xB000 , 0xFD00 )
489+
490+
491+ def is_tgllp_iris_xe (device = None ):
492+ """
493+ Return True if a test is running on Tiger Lake-LP with Iris Xe GPU device,
478494 False otherwise.
479495 """
480- return _get_dev_mask (device ) == 0xB000
496+ return get_dev_id (device ) in ( 0x9A49 , 0x9A40 )
481497
482498
483499def is_win_platform ():
0 commit comments