()
| 848 | del _mac_os_check |
| 849 | |
| 850 | def blas_fpe_check(): |
| 851 | if sys.platform != "darwin": |
| 852 | # We currently assume this is limited to MacOS as downstream NumPy |
| 853 | # import during dlopen caused a deadlock regression: gh-31284 |
| 854 | return |
| 855 | |
| 856 | # Check if BLAS adds spurious FPEs, seen on M4 arms with Accelerate. |
| 857 | # In this case we disable FPE reporting since the use of SME poisons |
| 858 | # it and Accelerate doesn't sanitize them. |
| 859 | with errstate(all='raise'): |
| 860 | x = ones((20, 20)) |
| 861 | try: |
| 862 | x @ x |
| 863 | except FloatingPointError: |
| 864 | res = _core._multiarray_umath._blas_supports_fpe(False) |
| 865 | if res: # res was not modified (hardcoded to True for now) |
| 866 | warnings.warn( |
| 867 | "Spurious warnings given by blas but suppression not " |
| 868 | "set up on this platform. Please open a NumPy issue.", |
| 869 | UserWarning, stacklevel=2) |
| 870 | |
| 871 | blas_fpe_check() |
| 872 | del blas_fpe_check |
no test coverage detected
searching dependent graphs…