diff options
author | Pauli Virtanen <pav@iki.fi> | 2010-09-11 14:52:07 +0000 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2010-09-11 14:52:07 +0000 |
commit | 3843e86ee3862103364b6aae2a0af8bd4ebdc986 (patch) | |
tree | 0f2906511908ec36e45cf80ce2ae247aaace08e9 | |
parent | b74533baef2a88255e36e680f5dba5c0f9dd4f7b (diff) | |
download | numpy-3843e86ee3862103364b6aae2a0af8bd4ebdc986.tar.gz |
BUG: core: fix _dotblas usage on Py3 (fixes #1609)
-rw-r--r-- | numpy/core/tests/test_blasdot.py | 16 | ||||
-rwxr-xr-x | tools/py3tool.py | 2 |
2 files changed, 16 insertions, 2 deletions
diff --git a/numpy/core/tests/test_blasdot.py b/numpy/core/tests/test_blasdot.py index aeaf55fbb..3c04759d5 100644 --- a/numpy/core/tests/test_blasdot.py +++ b/numpy/core/tests/test_blasdot.py @@ -1,5 +1,5 @@ from numpy.core import zeros, float64 -from numpy.testing import TestCase, assert_almost_equal +from numpy.testing import dec, TestCase, assert_almost_equal, assert_ from numpy.core.multiarray import inner as inner_ DECPREC = 14 @@ -12,3 +12,17 @@ class TestInner(TestCase): a = zeros(shape = (1, 80), dtype = float64) p = inner_(a, a) assert_almost_equal(p, 0, decimal = DECPREC) + +try: + import numpy.core._dotblas as _dotblas +except ImportError: + _dotblas = None + +@dec.skipif(_dotblas is None, "Numpy is not compiled with _dotblas") +def test_blasdot_used(): + from numpy.core import dot, vdot, inner, alterdot, restoredot + assert_(dot is _dotblas.dot) + assert_(vdot is _dotblas.vdot) + assert_(inner is _dotblas.inner) + assert_(alterdot is _dotblas.alterdot) + assert_(restoredot is _dotblas.restoredot) diff --git a/tools/py3tool.py b/tools/py3tool.py index 5d10f9591..09fe87442 100755 --- a/tools/py3tool.py +++ b/tools/py3tool.py @@ -157,7 +157,7 @@ def custom_mangling(filename): for mod in ['multiarray', 'scalarmath', 'umath', '_sort', '_compiled_base', 'core', 'lib', 'testing', 'fft', 'polynomial', 'random', 'ma', 'linalg', 'compat', - 'mtrand']: + 'mtrand', '_dotblas']: text = re.sub(r'^(\s*)import %s' % mod, r'\1from . import %s' % mod, text, flags=re.M) |