summaryrefslogtreecommitdiff
path: root/numpy/distutils/ccompiler_opt.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/distutils/ccompiler_opt.py')
-rw-r--r--numpy/distutils/ccompiler_opt.py50
1 files changed, 31 insertions, 19 deletions
diff --git a/numpy/distutils/ccompiler_opt.py b/numpy/distutils/ccompiler_opt.py
index 5f18efc7d..6ba4cd816 100644
--- a/numpy/distutils/ccompiler_opt.py
+++ b/numpy/distutils/ccompiler_opt.py
@@ -16,15 +16,6 @@ import re
import subprocess
import textwrap
-# These flags are used to compile any C++ source within Numpy.
-# They are chosen to have very few runtime dependencies.
-NPY_CXX_FLAGS = [
- '-std=c++11', # Minimal standard version
- '-D__STDC_VERSION__=0', # for compatibility with C headers
- '-fno-exceptions', # no exception support
- '-fno-rtti'] # no runtime type information
-
-
class _Config:
"""An abstract class holds all configurable attributes of `CCompilerOpt`,
these class attributes can be used to change the default behavior
@@ -229,6 +220,11 @@ class _Config:
native = None,
opt = '/O2',
werror = '/WX',
+ ),
+ fcc = dict(
+ native = '-mcpu=a64fx',
+ opt = None,
+ werror = None,
)
)
conf_min_features = dict(
@@ -295,6 +291,10 @@ class _Config:
group="AVX512VBMI2 AVX512BITALG AVX512VPOPCNTDQ",
detect="AVX512_ICL", implies_detect=False
),
+ AVX512_SPR = dict(
+ interest=46, implies="AVX512_ICL", group="AVX512FP16",
+ detect="AVX512_SPR", implies_detect=False
+ ),
# IBM/Power
## Power7/ISA 2.06
VSX = dict(interest=1, headers="altivec.h", extra_checks="VSX_ASM"),
@@ -338,7 +338,7 @@ class _Config:
return {}
on_x86 = self.cc_on_x86 or self.cc_on_x64
- is_unix = self.cc_is_gcc or self.cc_is_clang
+ is_unix = self.cc_is_gcc or self.cc_is_clang or self.cc_is_fcc
if on_x86 and is_unix: return dict(
SSE = dict(flags="-msse"),
@@ -365,7 +365,8 @@ class _Config:
AVX512_CNL = dict(flags="-mavx512ifma -mavx512vbmi"),
AVX512_ICL = dict(
flags="-mavx512vbmi2 -mavx512bitalg -mavx512vpopcntdq"
- )
+ ),
+ AVX512_SPR = dict(flags="-mavx512fp16"),
)
if on_x86 and self.cc_is_icc: return dict(
SSE = dict(flags="-msse"),
@@ -397,6 +398,7 @@ class _Config:
AVX512_CLX = dict(flags="-xCASCADELAKE"),
AVX512_CNL = dict(flags="-xCANNONLAKE"),
AVX512_ICL = dict(flags="-xICELAKE-CLIENT"),
+ AVX512_SPR = dict(disable="Not supported yet")
)
if on_x86 and self.cc_is_iccw: return dict(
SSE = dict(flags="/arch:SSE"),
@@ -429,7 +431,8 @@ class _Config:
AVX512_SKX = dict(flags="/Qx:SKYLAKE-AVX512"),
AVX512_CLX = dict(flags="/Qx:CASCADELAKE"),
AVX512_CNL = dict(flags="/Qx:CANNONLAKE"),
- AVX512_ICL = dict(flags="/Qx:ICELAKE-CLIENT")
+ AVX512_ICL = dict(flags="/Qx:ICELAKE-CLIENT"),
+ AVX512_SPR = dict(disable="Not supported yet")
)
if on_x86 and self.cc_is_msvc: return dict(
SSE = dict(flags="/arch:SSE") if self.cc_on_x86 else {},
@@ -467,7 +470,10 @@ class _Config:
AVX512_SKX = dict(flags="/arch:AVX512"),
AVX512_CLX = {},
AVX512_CNL = {},
- AVX512_ICL = {}
+ AVX512_ICL = {},
+ AVX512_SPR= dict(
+ disable="MSVC compiler doesn't support it"
+ )
)
on_power = self.cc_on_ppc64le or self.cc_on_ppc64
@@ -959,8 +965,12 @@ class _CCompiler:
detect_arch = (
("cc_on_x64", ".*(x|x86_|amd)64.*", ""),
("cc_on_x86", ".*(win32|x86|i386|i686).*", ""),
- ("cc_on_ppc64le", ".*(powerpc|ppc)64(el|le).*", ""),
- ("cc_on_ppc64", ".*(powerpc|ppc)64.*", ""),
+ ("cc_on_ppc64le", ".*(powerpc|ppc)64(el|le).*|.*powerpc.*",
+ "defined(__powerpc64__) && "
+ "defined(__LITTLE_ENDIAN__)"),
+ ("cc_on_ppc64", ".*(powerpc|ppc).*|.*powerpc.*",
+ "defined(__powerpc64__) && "
+ "defined(__BIG_ENDIAN__)"),
("cc_on_aarch64", ".*(aarch64|arm64).*", ""),
("cc_on_armhf", ".*arm.*", "defined(__ARM_ARCH_7__) || "
"defined(__ARM_ARCH_7A__)"),
@@ -975,12 +985,14 @@ class _CCompiler:
("cc_is_iccw", ".*(intelw|intelemw|iccw).*", ""),
("cc_is_icc", ".*(intel|icc).*", ""), # intel unix like
("cc_is_msvc", ".*msvc.*", ""),
+ ("cc_is_fcc", ".*fcc.*", ""),
# undefined compiler will be treat it as gcc
("cc_is_nocc", "", ""),
)
detect_args = (
("cc_has_debug", ".*(O0|Od|ggdb|coverage|debug:full).*", ""),
- ("cc_has_native", ".*(-march=native|-xHost|/QxHost).*", ""),
+ ("cc_has_native",
+ ".*(-march=native|-xHost|/QxHost|-mcpu=a64fx).*", ""),
# in case if the class run with -DNPY_DISABLE_OPTIMIZATION
("cc_noopt", ".*DISABLE_OPT.*", ""),
)
@@ -1041,7 +1053,7 @@ class _CCompiler:
break
self.cc_name = "unknown"
- for name in ("gcc", "clang", "iccw", "icc", "msvc"):
+ for name in ("gcc", "clang", "iccw", "icc", "msvc", "fcc"):
if getattr(self, "cc_is_" + name):
self.cc_name = name
break
@@ -1163,7 +1175,7 @@ class _CCompiler:
continue
lower_flags = flags[:-(i+1)]
upper_flags = flags[-i:]
- filterd = list(filter(
+ filtered = list(filter(
self._cc_normalize_unix_frgx.search, lower_flags
))
# gather subflags
@@ -1175,7 +1187,7 @@ class _CCompiler:
subflags = xsubflags + subflags
cur_flag = arch + '+' + '+'.join(subflags)
- flags = filterd + [cur_flag]
+ flags = filtered + [cur_flag]
if i > 0:
flags += upper_flags
break