summaryrefslogtreecommitdiff
path: root/numpy/distutils/command
diff options
context:
space:
mode:
authorRaghuveer Devulapalli <raghuveer.devulapalli@intel.com>2019-03-28 15:07:35 -0700
committerRaghuveer Devulapalli <raghuveer.devulapalli@intel.com>2019-04-19 10:47:15 -0700
commit651e03c0019d4c4c6ca8c43cb7d7c0d344a72cc1 (patch)
treef3d3333fa3427ba350344895d6bb850b8d5ca3ff /numpy/distutils/command
parentf9d14627b36bc25aace6c78e6e5f6fe68c08bfcb (diff)
downloadnumpy-651e03c0019d4c4c6ca8c43cb7d7c0d344a72cc1.tar.gz
BUG: Adding macro HAVE_ATTRIBUTE_TARGET_@ISA@_WITH_INTRINSICS
1) use __builtin_cpu_supports("avx512f") only for gcc ver >= 5 2) Introduced two new macro's: HAVE_ATTRIBUTE_TARGET_@ISA@_WITH_INTRINSICS for ensuring compiler can compile functions that use intrinsics and are compiled with avx2/avx512f attributes
Diffstat (limited to 'numpy/distutils/command')
-rw-r--r--numpy/distutils/command/autodist.py20
-rw-r--r--numpy/distutils/command/config.py6
2 files changed, 26 insertions, 0 deletions
diff --git a/numpy/distutils/command/autodist.py b/numpy/distutils/command/autodist.py
index d5e78963c..03fe0c64c 100644
--- a/numpy/distutils/command/autodist.py
+++ b/numpy/distutils/command/autodist.py
@@ -78,6 +78,26 @@ main()
""" % (attribute, name)
return cmd.try_compile(body, None, None) != 0
+def check_gcc_function_attribute_with_intrinsics(cmd, attribute, name, code,
+ include):
+ """Return True if the given function attribute is supported with
+ intrinsics."""
+ cmd._check_compiler()
+ body = """
+#include<%s>
+int %s %s(void)
+{
+ %s;
+ return 0;
+}
+
+int
+main()
+{
+ return 0;
+}
+""" % (include, attribute, name, code)
+ return cmd.try_compile(body, None, None) != 0
def check_gcc_variable_attribute(cmd, attribute):
"""Return True if the given variable attribute is supported."""
cmd._check_compiler()
diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py
index d9b1e8488..74d6900dc 100644
--- a/numpy/distutils/command/config.py
+++ b/numpy/distutils/command/config.py
@@ -18,6 +18,7 @@ import distutils
from numpy.distutils.exec_command import filepath_from_subprocess_output
from numpy.distutils.mingw32ccompiler import generate_manifest
from numpy.distutils.command.autodist import (check_gcc_function_attribute,
+ check_gcc_function_attribute_with_intrinsics,
check_gcc_variable_attribute,
check_inline,
check_restrict,
@@ -424,6 +425,11 @@ int main (void)
def check_gcc_function_attribute(self, attribute, name):
return check_gcc_function_attribute(self, attribute, name)
+ def check_gcc_function_attribute_with_intrinsics(self, attribute, name,
+ code, include):
+ return check_gcc_function_attribute_with_intrinsics(self, attribute,
+ name, code, include)
+
def check_gcc_variable_attribute(self, attribute):
return check_gcc_variable_attribute(self, attribute)