Skip to content

Commit

Permalink
TEST: changing range(6) to range(1,7) to avoid failure in reciprocal …
Browse files Browse the repository at this point in the history
…test
  • Loading branch information
r-devulap committed May 16, 2019
1 parent 1afc95d commit 4b4d2ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions numpy/core/src/umath/loops.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,13 @@ FLOAT_@func@_@isa@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY
{
if (!run_unary_@isa@_@func@_FLOAT(args, dimensions, steps)) {
UNARY_LOOP {
/*
* We use the AVX function to compute exp/log for scalar elements as well.
* This is needed to ensure the output of strided and non-strided
* cases match. But this worsens the performance of strided arrays.
* There is plan to fix this in a subsequent patch by using gather
* instructions for strided arrays in the AVX function.
*/
#if defined @CHK@ && defined NPY_HAVE_SSE2_INTRINSICS
@ISA@_@func@_FLOAT((npy_float *)op1, (npy_float *)ip1, 1);
#else
Expand Down
4 changes: 2 additions & 2 deletions numpy/core/tests/test_ufunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1981,9 +1981,9 @@ def test_ufunc_noncontiguous(ufunc):
args_c = [np.empty(6, t) for t in inp]
args_n = [np.empty(18, t)[::3] for t in inp]
for a in args_c:
a.flat = range(6)
a.flat = range(1,7)
for a in args_n:
a.flat = range(6)
a.flat = range(1,7)
with warnings.catch_warnings(record=True):
warnings.filterwarnings("always")
res_c = ufunc(*args_c)
Expand Down

0 comments on commit 4b4d2ab

Please sign in to comment.