summaryrefslogtreecommitdiff
path: root/numpy/distutils/tests
diff options
context:
space:
mode:
authorSayed Adel <seiko@imavr.com>2020-08-21 17:53:46 +0200
committerSayed Adel <seiko@imavr.com>2020-08-26 13:22:30 +0200
commit5281f86f386e530b10131193f3a7d5f338d8daaa (patch)
tree064a4d6f089deaea797ec6fba6795c1040b46688 /numpy/distutils/tests
parent0bd548e287b9e2fd0126f64d8be01a812e3c6a48 (diff)
downloadnumpy-5281f86f386e530b10131193f3a7d5f338d8daaa.tar.gz
BLD: Check for reduce intrinsics and AVX512BW mask operations
- Extending Distutils::CompilerOpt to allow adding extra separate test cases related to a certain CPU feature without affecting its availability. - Add test cases for reduce intrinsics and AVX512BW mask operations, they can be reached through C #defentions NPY_HAVE_AVX512BW_MASK and NPY_HAVE_AVX512F_REDUCE.
Diffstat (limited to 'numpy/distutils/tests')
-rw-r--r--numpy/distutils/tests/test_ccompiler_opt_conf.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/numpy/distutils/tests/test_ccompiler_opt_conf.py b/numpy/distutils/tests/test_ccompiler_opt_conf.py
index 2f83a59e0..5c4717192 100644
--- a/numpy/distutils/tests/test_ccompiler_opt_conf.py
+++ b/numpy/distutils/tests/test_ccompiler_opt_conf.py
@@ -66,11 +66,12 @@ class _TestConfFeatures(FakeCCompilerOpt):
self.test_implies(error_msg, search_in, feature_name, feature_dict)
self.test_group(error_msg, search_in, feature_name, feature_dict)
+ self.test_extra_checks(error_msg, search_in, feature_name, feature_dict)
def test_option_types(self, error_msg, option, val):
for tp, available in (
((str, list), (
- "implies", "headers", "flags", "group", "detect"
+ "implies", "headers", "flags", "group", "detect", "extra_checks"
)),
((str,), ("disable",)),
((int,), ("interest",)),
@@ -96,7 +97,7 @@ class _TestConfFeatures(FakeCCompilerOpt):
def test_duplicates(self, error_msg, option, val):
if option not in (
- "implies", "headers", "flags", "group", "detect"
+ "implies", "headers", "flags", "group", "detect", "extra_checks"
) : return
if isinstance(val, str):
@@ -151,6 +152,24 @@ class _TestConfFeatures(FakeCCompilerOpt):
option, f
))
+ def test_extra_checks(self, error_msg, search_in, feature_name, feature_dict):
+ if feature_dict.get("disabled") is not None:
+ return
+ extra_checks = feature_dict.get("extra_checks", "")
+ if not extra_checks:
+ return
+ if isinstance(extra_checks, str):
+ extra_checks = extra_checks.split()
+
+ for f in extra_checks:
+ impl_dict = search_in.get(f)
+ if not impl_dict or "disable" in impl_dict:
+ continue
+ raise AssertionError(error_msg + \
+ "in option '%s', extra test case '%s' already exists as a feature name" % (
+ option, f
+ ))
+
class TestConfFeatures(unittest.TestCase):
def __init__(self, methodName="runTest"):
unittest.TestCase.__init__(self, methodName)