diff options
author | Pauli Virtanen <pav@iki.fi> | 2019-12-15 23:16:18 +0200 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2019-12-21 23:13:19 +0200 |
commit | 4903971fce8fdd4dc38e66706432962a0a94e8d7 (patch) | |
tree | 4b41b7684c2e07fd0dfa442a2e490c6e9c7d3ddb /numpy/linalg/tests/test_linalg.py | |
parent | f554976fc5c342aa0e9e1fcdc59050325b18a68c (diff) | |
download | numpy-4903971fce8fdd4dc38e66706432962a0a94e8d7.tar.gz |
TST: linalg: add ilp64 lapack low-memory smoketest
LAPACK lwork call does not require much memory, and can be used as a
smoketest to whether LAPACK really uses 64-bit integers.
Diffstat (limited to 'numpy/linalg/tests/test_linalg.py')
-rw-r--r-- | numpy/linalg/tests/test_linalg.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/numpy/linalg/tests/test_linalg.py b/numpy/linalg/tests/test_linalg.py index bd3df1ca4..ef05b595e 100644 --- a/numpy/linalg/tests/test_linalg.py +++ b/numpy/linalg/tests/test_linalg.py @@ -2016,3 +2016,31 @@ def test_blas64_dot(): a[0,-1] = 1 c = np.dot(b, a) assert_equal(c[0,-1], 1) + + +@pytest.mark.xfail(not HAS_LAPACK64, + reason="Numpy not compiled with 64-bit BLAS/LAPACK") +def test_blas64_geqrf_lwork_smoketest(): + # Smoke test LAPACK geqrf lwork call with 64-bit integers + dtype = np.float64 + lapack_routine = np.linalg.lapack_lite.dgeqrf + + m = 2**32 + 1 + n = 2**32 + 1 + lda = m + + # Dummy arrays, not referenced by the lapack routine, so don't + # need to be of the right size + a = np.zeros([1, 1], dtype=dtype) + work = np.zeros([1], dtype=dtype) + tau = np.zeros([1], dtype=dtype) + + # Size query + results = lapack_routine(m, n, a, lda, tau, work, -1, 0) + assert_equal(results['info'], 0) + assert_equal(results['m'], m) + assert_equal(results['n'], m) + + # Should result to an integer of a reasonable size + lwork = int(work.item()) + assert_(2**32 < lwork < 2**42) |