summaryrefslogtreecommitdiff
path: root/numpy/core/src/scalarmathmodule.c.src
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-05-25 08:49:23 -0700
committerCharles Harris <charlesr.harris@gmail.com>2013-05-25 08:49:23 -0700
commit31a550189371ed21f8d38edae02f71f18a729741 (patch)
tree19796f011b64c1a27d1f0fa27cc1f39e89869739 /numpy/core/src/scalarmathmodule.c.src
parenta02457f1d76dc6727f2118f2d129ce3a5261c253 (diff)
parentfe69102dd34619ce18cf074ef0e6e46611bc17e7 (diff)
downloadnumpy-31a550189371ed21f8d38edae02f71f18a729741.tar.gz
Merge pull request #3341 from juliantaylor/sse2-sqrt
vectorize sqrt ufunc with SSE2
Diffstat (limited to 'numpy/core/src/scalarmathmodule.c.src')
-rw-r--r--numpy/core/src/scalarmathmodule.c.src10
1 files changed, 8 insertions, 2 deletions
diff --git a/numpy/core/src/scalarmathmodule.c.src b/numpy/core/src/scalarmathmodule.c.src
index 11716dd46..0f5f195f4 100644
--- a/numpy/core/src/scalarmathmodule.c.src
+++ b/numpy/core/src/scalarmathmodule.c.src
@@ -1766,8 +1766,14 @@ get_functions(void)
}
funcdata = ((PyUFuncObject *)obj)->data;
signatures = ((PyUFuncObject *)obj)->types;
- i = 0;
- j = 0;
+ /*
+ * sqrt ufunc is specialized for double and float loops in
+ * generate_umath.py, the first to go into FLOAT/DOUBLE_sqrt
+ * they have the same signature as the scalar variants so we need to skip
+ * over them
+ */
+ i = 4;
+ j = 2;
while (signatures[i] != NPY_FLOAT) {
i += 2; j++;
}