diff options
author | Ralf Gommers <ralf.gommers@gmail.com> | 2021-05-29 16:50:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-29 16:50:32 +0200 |
commit | 565cb733b5d4d981ad0af29cf8492e97c45194af (patch) | |
tree | 9347a2d677d88a31c5c51cc215d13f00c04a0252 | |
parent | 1ad61f0d72c07faa5ede548404c9d0cddc3d1423 (diff) | |
parent | 9417f42d2dcfdf5ac46170bb8ede548499339789 (diff) | |
download | numpy-565cb733b5d4d981ad0af29cf8492e97c45194af.tar.gz |
Merge pull request #19130 from ganesh-k13/ENH_18490_CPU_feature_show
ENH: SIMD architectures to show_config
-rw-r--r-- | numpy/distutils/misc_util.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py index e797745e1..60696438f 100644 --- a/numpy/distutils/misc_util.py +++ b/numpy/distutils/misc_util.py @@ -2357,6 +2357,10 @@ def generate_config_py(target): * ``src_dirs``: directories containing library source files * ``define_macros``: preprocessor macros used by ``distutils.setup`` + * ``baseline``: minimum CPU features required + * ``found``: dispatched features supported in the system + * ``not found``: dispatched features that are not supported + in the system Examples -------- @@ -2368,6 +2372,9 @@ def generate_config_py(target): libraries = ['openblas', 'openblas'] library_dirs = ['/usr/local/lib'] """ + from numpy.core._multiarray_umath import ( + __cpu_features__, __cpu_baseline__, __cpu_dispatch__ + ) for name,info_dict in globals().items(): if name[0] == "_" or type(info_dict) is not type({}): continue print(name + ":") @@ -2378,6 +2385,19 @@ def generate_config_py(target): if k == "sources" and len(v) > 200: v = v[:60] + " ...\n... " + v[-60:] print(" %s = %s" % (k,v)) + + features_found, features_not_found = [], [] + for feature in __cpu_dispatch__: + if __cpu_features__[feature]: + features_found.append(feature) + else: + features_not_found.append(feature) + + print("Supported SIMD extensions in this NumPy install:") + print(" baseline = %s" % (','.join(__cpu_baseline__))) + print(" found = %s" % (','.join(features_found))) + print(" not found = %s" % (','.join(features_not_found))) + ''')) return target |