Skip to content

Commit fb3bf2e

Browse files
committed
hack zgetrf to reset FPE registers [wheel build]
1 parent 832f33e commit fb3bf2e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

numpy/linalg/umath_linalg.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,14 @@ static fortran_int getrf(fortran_int *m, fortran_int *n, f2c_complex a[], fortra
818818
}
819819
static fortran_int getrf(fortran_int *m, fortran_int *n, f2c_doublecomplex a[], fortran_int
820820
*lda, fortran_int ipiv[], fortran_int *info) {
821-
return LAPACK(zgetrf)(m, n, a, lda, ipiv, info);
821+
// printf("calling zgetrf m=%d, n=%d, lda=%d\n", m[0], n[0], lda[0]);
822+
fortran_int ret = LAPACK(zgetrf)(m, n, a, lda, ipiv, info);
823+
#if defined(__aarch64__) && (defined(__apple__) || defined(__APPLE__))
824+
// See gh-29280: this call sets the floating point error registers
825+
// even when no FPE occurs
826+
npy_clear_floatstatus_barrier((char*)&ret);
827+
#endif
828+
return ret;
822829
}
823830

824831
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy