diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2013-09-12 12:05:54 +0200 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2013-09-12 12:19:07 +0200 |
commit | 5262478f4d8b1569c1d675bcbd1806c19e4ea597 (patch) | |
tree | 4c8cf286c74d9559e8cb863ecfd9496c411b7dfd | |
parent | 1dd3778b8ea42d4c3e5315a80dd2baed36212649 (diff) | |
download | numpy-5262478f4d8b1569c1d675bcbd1806c19e4ea597.tar.gz |
BUG: fix bad alignment asserts
if the arrays are smaller than a vector they don't need to be aligned.
-rw-r--r-- | numpy/core/src/umath/simd.inc.src | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/src/umath/simd.inc.src b/numpy/core/src/umath/simd.inc.src index 2f1c3055b..e1fe6c5b5 100644 --- a/numpy/core/src/umath/simd.inc.src +++ b/numpy/core/src/umath/simd.inc.src @@ -595,7 +595,7 @@ sse2_sqrt_@TYPE@(@type@ * op, @type@ * ip, const npy_intp n) LOOP_BLOCK_ALIGN_VAR(op, @type@, 16) { op[i] = @scalarf@(ip[i]); } - assert(npy_is_aligned(&op[i], 16)); + assert(n < (16 / sizeof(@type@)) || npy_is_aligned(&op[i], 16)); if (npy_is_aligned(&ip[i], 16)) { LOOP_BLOCKED(@type@, 16) { @vtype@ d = @vpre@_load_@vsuf@(&ip[i]); @@ -630,7 +630,7 @@ sse2_absolute_@TYPE@(@type@ * op, @type@ * ip, const npy_intp n) /* add 0 to clear -0.0 */ op[i] = tmp + 0; } - assert(npy_is_aligned(&op[i], 16)); + assert(n < (16 / sizeof(@type@)) || npy_is_aligned(&op[i], 16)); if (npy_is_aligned(&ip[i], 16)) { LOOP_BLOCKED(@type@, 16) { @vtype@ a = @vpre@_load_@vsuf@(&ip[i]); @@ -663,7 +663,7 @@ sse2_@kind@_@TYPE@(@type@ * ip, @type@ * op, const npy_intp n) LOOP_BLOCK_ALIGN_VAR(ip, @type@, 16) { *op = (*op @OP@ ip[i] || npy_isnan(*op)) ? *op : ip[i]; } - assert(npy_is_aligned(&ip[i], 16)); + assert(n < (16 / sizeof(@type@)) || npy_is_aligned(&ip[i], 16)); if (i + 2 * 16 / sizeof(@type@) <= n) { /* load the first elements */ @vtype@ c = @vpre@_load_@vsuf@((@type@*)&ip[i]); |