File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -397,6 +397,22 @@ def is_gpu_device(device=None):
397
397
return dev .has_aspect_gpu
398
398
399
399
400
+ def is_intel_numpy ():
401
+ """
402
+ Return True if Intel NumPy is used during testing.
403
+
404
+ The check is based on MKL backend name stored in Build Dependencies, where
405
+ in case of Intel Numpy there "mkl-dynamic" is expected to be a part of the
406
+ name for both BLAS and LAPACK (the full name is "mkl-dynamic-ilp64-iomp").
407
+
408
+ """
409
+
410
+ build_deps = numpy .show_config (mode = "dicts" )["Build Dependencies" ]
411
+ blas = build_deps ["blas" ]
412
+ lapack = build_deps ["lapack" ]
413
+ return all ("mkl-dynamic" in dep ["name" ] for dep in [blas , lapack ])
414
+
415
+
400
416
def is_win_platform ():
401
417
"""
402
418
Return True if a test is running on Windows OS, False otherwise.
Original file line number Diff line number Diff line change 32
32
get_integer_float_dtypes ,
33
33
has_support_aspect16 ,
34
34
has_support_aspect64 ,
35
+ is_intel_numpy ,
35
36
numpy_version ,
36
37
)
37
38
from .third_party .cupy import testing
@@ -1756,11 +1757,11 @@ def test_zeros(self, dt):
1756
1757
1757
1758
result = dpnp .spacing (ia )
1758
1759
expected = numpy .spacing (a )
1759
- if numpy_version () < "2.0.0" :
1760
+ if is_intel_numpy () :
1760
1761
assert_allclose (result , expected )
1761
1762
else :
1762
- # numpy.spacing(-0.0) == numpy.spacing(0.0), i.e. NumPy returns
1763
- # positive value (looks as a bug in NumPy ), because for any other
1763
+ # numpy.spacing(-0.0) == numpy.spacing(0.0), i.e. the stock NumPy
1764
+ # returns positive value (looks as a bug), because for any other
1764
1765
# negative input the NumPy result will be also a negative value.
1765
1766
expected [1 ] *= - 1
1766
1767
assert_allclose (result , expected )
You can’t perform that action at this time.
0 commit comments