summaryrefslogtreecommitdiff
path: root/numpy/distutils/tests
diff options
context:
space:
mode:
authorSayed Adel <seiko@imavr.com>2021-12-14 15:11:52 +0200
committerSayed Adel <seiko@imavr.com>2021-12-14 16:35:49 +0200
commit9cedd787f630fadcff4d256b89aa6ea19bdcdeef (patch)
tree6d109ccd056a4eee2dce0eb8801a1f449b9f1aab /numpy/distutils/tests
parent57628078ef81632f11d22a8fbe84e3a9a85ff748 (diff)
downloadnumpy-9cedd787f630fadcff4d256b89aa6ea19bdcdeef.tar.gz
TST: expend ccompiler tests to cover s390x features
Diffstat (limited to 'numpy/distutils/tests')
-rw-r--r--numpy/distutils/tests/test_ccompiler_opt.py75
1 files changed, 45 insertions, 30 deletions
diff --git a/numpy/distutils/tests/test_ccompiler_opt.py b/numpy/distutils/tests/test_ccompiler_opt.py
index 1b27ab07c..6d42cc172 100644
--- a/numpy/distutils/tests/test_ccompiler_opt.py
+++ b/numpy/distutils/tests/test_ccompiler_opt.py
@@ -32,6 +32,7 @@ arch_compilers = dict(
ppc64le = ("gcc", "clang"),
armhf = ("gcc", "clang"),
aarch64 = ("gcc", "clang"),
+ s390x = ("gcc", "clang"),
noarch = ("gcc",)
)
@@ -382,18 +383,19 @@ class _Test_CCompilerOpt:
if o == "native" and self.cc_name() == "msvc":
continue
self.expect(o,
- trap_files=".*cpu_(sse|vsx|neon).c",
- x86="", ppc64="", armhf=""
+ trap_files=".*cpu_(sse|vsx|neon|vx).c",
+ x86="", ppc64="", armhf="", s390x=""
)
self.expect(o,
- trap_files=".*cpu_(sse3|vsx2|neon_vfpv4).c",
+ trap_files=".*cpu_(sse3|vsx2|neon_vfpv4|vxe).c",
x86="sse sse2", ppc64="vsx", armhf="neon neon_fp16",
- aarch64="", ppc64le=""
+ aarch64="", ppc64le="", s390x="vx"
)
self.expect(o,
trap_files=".*cpu_(popcnt|vsx3).c",
x86="sse .* sse41", ppc64="vsx vsx2",
- armhf="neon neon_fp16 .* asimd .*"
+ armhf="neon neon_fp16 .* asimd .*",
+ s390x="vx vxe vxe2"
)
self.expect(o,
x86_gcc=".* xop fma4 .* avx512f .* avx512_knl avx512_knm avx512_skx .*",
@@ -403,13 +405,14 @@ class _Test_CCompilerOpt:
# in msvc, avx512_knl avx512_knm aren't supported
x86_msvc=".* xop fma4 .* avx512f .* avx512_skx .*",
armhf=".* asimd asimdhp asimddp .*",
- ppc64="vsx vsx2 vsx3.*"
+ ppc64="vsx vsx2 vsx3.*",
+ s390x="vx vxe vxe2.*"
)
# min
self.expect("min",
x86="sse sse2", x64="sse sse2 sse3",
armhf="", aarch64="neon neon_fp16 .* asimd",
- ppc64="", ppc64le="vsx vsx2"
+ ppc64="", ppc64le="vsx vsx2", s390x=""
)
self.expect(
"min", trap_files=".*cpu_(sse2|vsx2).c",
@@ -420,7 +423,7 @@ class _Test_CCompilerOpt:
try:
self.expect("native",
trap_flags=".*(-march=native|-xHost|/QxHost).*",
- x86=".*", ppc64=".*", armhf=".*"
+ x86=".*", ppc64=".*", armhf=".*", s390x=".*"
)
if self.march() != "unknown":
raise AssertionError(
@@ -432,14 +435,15 @@ class _Test_CCompilerOpt:
def test_flags(self):
self.expect_flags(
- "sse sse2 vsx vsx2 neon neon_fp16",
+ "sse sse2 vsx vsx2 neon neon_fp16 vx vxe",
x86_gcc="-msse -msse2", x86_icc="-msse -msse2",
x86_iccw="/arch:SSE2",
x86_msvc="/arch:SSE2" if self.march() == "x86" else "",
ppc64_gcc= "-mcpu=power8",
ppc64_clang="-maltivec -mvsx -mpower8-vector",
armhf_gcc="-mfpu=neon-fp16 -mfp16-format=ieee",
- aarch64=""
+ aarch64="",
+ s390="-mzvector -march=arch12"
)
# testing normalize -march
self.expect_flags(
@@ -484,7 +488,7 @@ class _Test_CCompilerOpt:
try:
self.expect_targets(
targets,
- x86="", armhf="", ppc64=""
+ x86="", armhf="", ppc64="", s390x=""
)
if self.march() != "unknown":
raise AssertionError(
@@ -496,26 +500,26 @@ class _Test_CCompilerOpt:
def test_targets_syntax(self):
for targets in (
- "/*@targets $keep_baseline sse vsx neon*/",
- "/*@targets,$keep_baseline,sse,vsx,neon*/",
- "/*@targets*$keep_baseline*sse*vsx*neon*/",
+ "/*@targets $keep_baseline sse vsx neon vx*/",
+ "/*@targets,$keep_baseline,sse,vsx,neon vx*/",
+ "/*@targets*$keep_baseline*sse*vsx*neon*vx*/",
"""
/*
** @targets
- ** $keep_baseline, sse vsx,neon
+ ** $keep_baseline, sse vsx,neon, vx
*/
""",
"""
/*
- ************@targets*************
- ** $keep_baseline, sse vsx, neon
- *********************************
+ ************@targets****************
+ ** $keep_baseline, sse vsx, neon, vx
+ ************************************
*/
""",
"""
/*
/////////////@targets/////////////////
- //$keep_baseline//sse//vsx//neon
+ //$keep_baseline//sse//vsx//neon//vx
/////////////////////////////////////
*/
""",
@@ -523,11 +527,11 @@ class _Test_CCompilerOpt:
/*
@targets
$keep_baseline
- SSE VSX NEON*/
+ SSE VSX NEON VX*/
"""
) :
self.expect_targets(targets,
- x86="sse", ppc64="vsx", armhf="neon", unknown=""
+ x86="sse", ppc64="vsx", armhf="neon", s390x="vx", unknown=""
)
def test_targets(self):
@@ -538,10 +542,12 @@ class _Test_CCompilerOpt:
sse sse2 sse41 avx avx2 avx512f
vsx vsx2 vsx3
neon neon_fp16 asimdhp asimddp
+ vx vxe vxe2
*/
""",
- baseline="avx vsx2 asimd",
- x86="avx512f avx2", armhf="asimddp asimdhp", ppc64="vsx3"
+ baseline="avx vsx2 asimd vx vxe",
+ x86="avx512f avx2", armhf="asimddp asimdhp", ppc64="vsx3",
+ s390x="vxe2"
)
# test skipping non-dispatch features
self.expect_targets(
@@ -550,10 +556,11 @@ class _Test_CCompilerOpt:
sse41 avx avx2 avx512f
vsx2 vsx3
asimd asimdhp asimddp
+ vx vxe vxe2
*/
""",
- baseline="", dispatch="sse41 avx2 vsx2 asimd asimddp",
- x86="avx2 sse41", armhf="asimddp asimd", ppc64="vsx2"
+ baseline="", dispatch="sse41 avx2 vsx2 asimd asimddp vxe2",
+ x86="avx2 sse41", armhf="asimddp asimd", ppc64="vsx2", s390x="vxe2"
)
# test skipping features that not supported
self.expect_targets(
@@ -562,11 +569,13 @@ class _Test_CCompilerOpt:
sse2 sse41 avx2 avx512f
vsx2 vsx3
neon asimdhp asimddp
+ vx vxe vxe2
*/
""",
baseline="",
- trap_files=".*(avx2|avx512f|vsx3|asimddp).c",
- x86="sse41 sse2", ppc64="vsx2", armhf="asimdhp neon"
+ trap_files=".*(avx2|avx512f|vsx3|asimddp|vxe2).c",
+ x86="sse41 sse2", ppc64="vsx2", armhf="asimdhp neon",
+ s390x="vxe vx"
)
# test skipping features that implies each other
self.expect_targets(
@@ -598,14 +607,16 @@ class _Test_CCompilerOpt:
sse2 sse42 avx2 avx512f
vsx2 vsx3
neon neon_vfpv4 asimd asimddp
+ vx vxe vxe2
*/
""",
- baseline="sse41 avx2 vsx2 asimd vsx3",
+ baseline="sse41 avx2 vsx2 asimd vsx3 vxe",
x86="avx512f avx2 sse42 sse2",
ppc64="vsx3 vsx2",
armhf="asimddp asimd neon_vfpv4 neon",
# neon, neon_vfpv4, asimd implies each other
- aarch64="asimddp asimd"
+ aarch64="asimddp asimd",
+ s390x="vxe2 vxe vx"
)
# 'keep_sort', leave the sort as-is
self.expect_targets(
@@ -615,13 +626,15 @@ class _Test_CCompilerOpt:
avx512f sse42 avx2 sse2
vsx2 vsx3
asimd neon neon_vfpv4 asimddp
+ vxe vxe2
*/
""",
x86="avx512f sse42 avx2 sse2",
ppc64="vsx2 vsx3",
armhf="asimd neon neon_vfpv4 asimddp",
# neon, neon_vfpv4, asimd implies each other
- aarch64="asimd asimddp"
+ aarch64="asimd asimddp",
+ s390x="vxe vxe2"
)
# 'autovec', skipping features that can't be
# vectorized by the compiler
@@ -736,11 +749,13 @@ class _Test_CCompilerOpt:
(sse41 avx sse42) (sse3 avx2 avx512f)
(vsx vsx3 vsx2)
(asimddp neon neon_vfpv4 asimd asimdhp)
+ (vx vxe vxe2)
*/
""",
x86="avx avx512f",
ppc64="vsx3",
armhf=r"\(asimdhp asimddp\)",
+ s390x="vxe2"
)
# test compiler variety and avoiding duplicating
self.expect_targets(