@@ -48,13 +48,47 @@ def run(label, fn):
4848 print (" %-46s -> ERROR %s: %s" % (label , type (e ).__name__ , e ))
4949
5050
51+ def cpu_info ():
52+ import platform
53+ lines = []
54+ try :
55+ import numpy ._core ._multiarray_umath as _mu
56+ lines .append (" numpy baseline : %s" % (getattr (_mu , "__cpu_baseline__" , "?" ),))
57+ lines .append (" numpy dispatch : %s" % (getattr (_mu , "__cpu_dispatch__" , "?" ),))
58+ except Exception as e : # noqa: BLE001
59+ lines .append (" numpy cpu features : <err %s>" % e )
60+ lines .append (" platform.processor : %r" % platform .processor ())
61+ lines .append (" platform.machine : %r" % platform .machine ())
62+ lines .append (" PROCESSOR_IDENTIFIER: %r" % os .environ .get ("PROCESSOR_IDENTIFIER" ))
63+ brand = None
64+ for cmd in (
65+ ["powershell" , "-NoProfile" , "-Command" , "(Get-CimInstance Win32_Processor).Name" ],
66+ ["wmic" , "cpu" , "get" , "name" ],
67+ ):
68+ try :
69+ out = subprocess .run (cmd , capture_output = True , text = True , timeout = 30 )
70+ txt = " / " .join (
71+ ln .strip () for ln in out .stdout .splitlines ()
72+ if ln .strip () and ln .strip () != "Name"
73+ )
74+ if txt :
75+ brand = txt
76+ break
77+ except Exception : # noqa: BLE001
78+ continue
79+ lines .append (" CPU brand : %r" % (brand ,))
80+ return "\n " .join (lines )
81+
82+
5183TAG = "FT" if not gil_enabled () else "GIL"
5284
5385print ("\n ########## quaddtype win-ft probe [%s] ##########" % TAG )
5486print ("python : %s gil_enabled=%s" % (sys .version .split ()[0 ], gil_enabled ()))
5587print ("numpy : %s" % np .__version__ )
5688print ("quaddtype : %s" % getattr (nq , "__version__" , "?" ))
5789run ("is_longdouble_128" , nq .is_longdouble_128 )
90+ print ("[%s] CPU / SIMD environment:" % TAG )
91+ print (cpu_info ())
5892
5993print ("[%s] PURE numpy special-value checks (NO quaddtype involved):" % TAG )
6094run ("np.isinf(float('inf'))" , lambda : np .isinf (float ("inf" )))
0 commit comments