@@ -27,9 +27,7 @@ def _assert_shape(a, b):
27
27
28
28
29
29
def _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
33
31
34
32
35
33
def assert_dtype_allclose (
@@ -110,6 +108,19 @@ def assert_dtype_allclose(
110
108
_assert_dtype (dpnp_arr .dtype , numpy_arr .dtype , check_only_type_kind )
111
109
112
110
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
+
113
124
def generate_random_numpy_array (
114
125
shape ,
115
126
dtype = None ,
@@ -208,19 +219,6 @@ def generate_random_numpy_array(
208
219
return a
209
220
210
221
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
-
224
222
def get_abs_array (data , dtype = None ):
225
223
if numpy .issubdtype (dtype , numpy .unsignedinteger ):
226
224
data = numpy .abs (data )
@@ -305,6 +303,16 @@ def get_complex_dtypes(device=None):
305
303
return dtypes
306
304
307
305
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
+
308
316
def get_float_dtypes (no_float16 = True , device = None ):
309
317
"""
310
318
Build a list of floating types supported by DPNP based on device capabilities.
@@ -456,11 +464,11 @@ def is_intel_numpy():
456
464
return all (dep ["name" ].startswith ("mkl" ) for dep in [blas , lapack ])
457
465
458
466
459
- def is_iris_xe (device = None ):
467
+ def is_lnl (device = None ):
460
468
"""
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.
462
470
"""
463
- return _get_dev_mask (device ) == 0x9A00
471
+ return _get_dev_mask (device ) == 0x6400
464
472
465
473
466
474
def is_lts_driver (device = None ):
@@ -474,10 +482,18 @@ def is_lts_driver(device=None):
474
482
475
483
def is_ptl (device = None ):
476
484
"""
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,
478
494
False otherwise.
479
495
"""
480
- return _get_dev_mask (device ) == 0xB000
496
+ return get_dev_id (device ) in ( 0x9A49 , 0x9A40 )
481
497
482
498
483
499
def is_win_platform ():
0 commit comments