diff options
-rw-r--r-- | numpy/core/src/umath/loops.c.src | 12 | ||||
-rw-r--r-- | numpy/core/src/umath/loops_arithm_fp.dispatch.c.src | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/numpy/core/src/umath/loops.c.src b/numpy/core/src/umath/loops.c.src index 2b70a4b9a..085712f38 100644 --- a/numpy/core/src/umath/loops.c.src +++ b/numpy/core/src/umath/loops.c.src @@ -540,6 +540,18 @@ NPY_NO_EXPORT NPY_GCC_OPT_3 @ATTR@ void BINARY_LOOP_FAST(@type@, @type@, *out = in1 @OP@ in2); } } + +NPY_NO_EXPORT NPY_GCC_OPT_3 @ATTR@ void +@TYPE@_@kind@@isa@_indexed(char const *ip1, npy_intp const *indx, char *value, + npy_intp const *dimensions, npy_intp const *steps) { + npy_intp is1 = steps[0], is2 = steps[1], os1 = steps[2]; + npy_intp n = dimensions[0]; + npy_intp i; + for(i = 0; i < n; i++, indx += is2, value += os1) { + @type@ op1 = *(@type@ *)(ip1 + is1 * indx[0]) + value[0]; + } +} + #endif /**end repeat2**/ diff --git a/numpy/core/src/umath/loops_arithm_fp.dispatch.c.src b/numpy/core/src/umath/loops_arithm_fp.dispatch.c.src index c1bfaa63a..1436c46f4 100644 --- a/numpy/core/src/umath/loops_arithm_fp.dispatch.c.src +++ b/numpy/core/src/umath/loops_arithm_fp.dispatch.c.src @@ -546,6 +546,18 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(@TYPE@_@kind@) } } } + +NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(@TYPE@_@kind@_indexed) +(char const *ip1, npy_intp const *indx, char *value, + npy_intp const *dimensions, npy_intp const *steps) { + npy_intp is1 = steps[0], is2 = steps[1], os1 = steps[2]; + npy_intp n = dimensions[0]; + npy_intp i; + for(i = 0; i < n; i++, indx += is2, value += os1) { + @type@ op1 = *(@type@ *)(ip1 + is1 * indx[0]) + value[0]; + } +} + /**end repeat1**/ /**end repeat**/ |