summaryrefslogtreecommitdiff
path: root/numpy/core/setup.py
diff options
context:
space:
mode:
authorSayed Adel <seiko@imavr.com>2020-07-08 09:27:13 +0200
committerSayed Adel <seiko@imavr.com>2020-10-27 11:46:58 +0000
commitcb3efe8e03b53dbab457a99be1a48384312abe16 (patch)
tree519f83bd1bda84f52fba88516561dd79e0f36826 /numpy/core/setup.py
parentfcba5a6c901717110b9767b418df410d7c8c6e73 (diff)
downloadnumpy-cb3efe8e03b53dbab457a99be1a48384312abe16.tar.gz
ENH: Expose the NumPy C SIMD vectorization interface "NPYV" to Python
'_simd' is a new module to bring the NumPy C SIMD vectorization interface "NPYV" The module is designed to be extremely flexible so that it can accommodate any kind intrinsics, also to generate a python interface almost similar to the C interface. The main purpose of this module is to test NPYV intrinsics in python, but still can be used as an effective solution in designing SIMD kernels. Also add a new command-line argument `--simd-test` to control of targeted CPU features for the `_simd` module. Co-authored-by: Matti Picus <matti.picus@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Diffstat (limited to 'numpy/core/setup.py')
-rw-r--r--numpy/core/setup.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index b3e17baed..e9a9a4e46 100644
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -626,6 +626,7 @@ def configuration(parent_package='',top_path=None):
config.add_include_dirs(join('src', 'multiarray'))
config.add_include_dirs(join('src', 'umath'))
config.add_include_dirs(join('src', 'npysort'))
+ config.add_include_dirs(join('src', '_simd'))
config.add_define_macros([("NPY_INTERNAL_BUILD", "1")]) # this macro indicates that Numpy build is in process
config.add_define_macros([("HAVE_NPY_CONFIG_H", "1")])
@@ -974,6 +975,28 @@ def configuration(parent_package='',top_path=None):
config.add_extension('_operand_flag_tests',
sources=[join('src', 'umath', '_operand_flag_tests.c.src')])
+ #######################################################################
+ # SIMD module #
+ #######################################################################
+
+ config.add_extension('_simd', sources=[
+ join('src', 'common', 'npy_cpu_features.c.src'),
+ join('src', '_simd', '_simd.c'),
+ join('src', '_simd', '_simd_inc.h.src'),
+ join('src', '_simd', '_simd_inc_data.h.src'),
+ join('src', '_simd', '_simd.dispatch.c.src'),
+ ], depends=[
+ join('src', 'common', 'npy_cpu_dispatch.h'),
+ join('src', 'common', 'simd', 'simd.h'),
+ join('src', '_simd', '_simd.h'),
+ join('src', '_simd', '_simd_inc.h.src'),
+ join('src', '_simd', '_simd_inc_data.h.src'),
+ join('src', '_simd', '_simd_inc_arg.h'),
+ join('src', '_simd', '_simd_inc_convert.h'),
+ join('src', '_simd', '_simd_inc_easyintrin.h'),
+ join('src', '_simd', '_simd_inc_vector.h'),
+ ])
+
config.add_subpackage('tests')
config.add_data_dir('tests/data')
config.add_data_dir('tests/examples')