1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
From: Michael R. Crusoe <crusoe@debian.org>
Subject: add SIMD everywhere for non x86 support
Forwarded: https://github.com/biocore/scikit-bio/pull/1709
--- python-skbio.orig/skbio/alignment/_lib/ssw.c
+++ python-skbio/skbio/alignment/_lib/ssw.c
@@ -35,7 +35,8 @@
*
*/
-#include <emmintrin.h>
+#define SIMDE_ENABLE_NATIVE_ALIASES
+#include "simde/x86/sse2.h"
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
--- python-skbio.orig/skbio/alignment/_lib/ssw.h
+++ python-skbio/skbio/alignment/_lib/ssw.h
@@ -14,7 +14,8 @@
#include <stdio.h>
#include <stdint.h>
#include <string.h>
-#include <emmintrin.h>
+#define SIMDE_ENABLE_NATIVE_ALIASES
+#include "simde/x86/sse2.h"
/*! @typedef structure of the query profile */
struct _profile;
@@ -127,4 +128,4 @@
}
#endif // __cplusplus
-#endif // SSW_H
\ No newline at end of file
+#endif // SSW_H
--- python-skbio.orig/setup.py
+++ python-skbio/setup.py
@@ -60,19 +60,24 @@
USE_CYTHON = os.environ.get('USE_CYTHON', False)
ext = '.pyx' if USE_CYTHON else '.c'
+extra_args = ["-DSIMDE_ENABLE_OPENMP", "-fopenmp-simd", "-O3"]
extensions = [
Extension("skbio.metadata._intersection",
- ["skbio/metadata/_intersection" + ext]),
+ ["skbio/metadata/_intersection" + ext],
+ extra_compile_args=extra_args),
Extension("skbio.stats.__subsample",
["skbio/stats/__subsample" + ext],
- include_dirs=[np.get_include()]),
+ include_dirs=[np.get_include()],
+ extra_compile_args=extra_args),
Extension("skbio.alignment._ssw_wrapper",
["skbio/alignment/_ssw_wrapper" + ext],
include_dirs=[np.get_include()],
- libraries=['ssw']),
+ libraries=['ssw'],
+ extra_compile_args=extra_args),
Extension("skbio.diversity._phylogenetic",
["skbio/diversity/_phylogenetic" + ext],
- include_dirs=[np.get_include()])
+ include_dirs=[np.get_include()],
+ extra_compile_args=extra_args)
]
if USE_CYTHON:
|