a :jg– ã@s dZddlZdgZddd„ZdS)z! Introspection helper functions. éNÚ opt_func_infoc s²ddlm}m‰|dur:t |¡‰‡fdd„| ¡Dƒ}n|}|durªt |¡‰i}| ¡D]J\}}i}| ¡D](\}}t‡‡fdd„|Dƒƒrp|||<qp|r\|||<q\n|}|S)aR Returns a dictionary containing the currently supported CPU dispatched features for all optimized functions. Parameters ---------- func_name : str (optional) Regular expression to filter by function name. signature : str (optional) Regular expression to filter by data type. Returns ------- dict A dictionary where keys are optimized function names and values are nested dictionaries indicating supported targets based on data types. Examples -------- Retrieve dispatch information for functions named 'add' or 'sub' and data types 'float64' or 'float32': >>> dict = np.lib.introspect.opt_func_info( ... func_name="add|abs", signature="float64|complex64" ... ) >>> import json >>> print(json.dumps(dict, indent=2)) { "absolute": { "dd": { "current": "SSE41", "available": "SSE41 baseline(SSE SSE2 SSE3)" }, "Ff": { "current": "FMA3__AVX2", "available": "AVX512F FMA3__AVX2 baseline(SSE SSE2 SSE3)" }, "Dd": { "current": "FMA3__AVX2", "available": "AVX512F FMA3__AVX2 baseline(SSE SSE2 SSE3)" } }, "add": { "ddd": { "current": "FMA3__AVX2", "available": "FMA3__AVX2 baseline(SSE SSE2 SSE3)" }, "FFF": { "current": "FMA3__AVX2", "available": "FMA3__AVX2 baseline(SSE SSE2 SSE3)" } } } r)Ú__cpu_targets_info__ÚdtypeNcs i|]\}}ˆ |¡r||“qS©)Úsearch)Ú.0ÚkÚv)Ú func_patternrú>/usr/local/lib/python3.9/site-packages/numpy/lib/introspect.pyÚ Hs ÿz!opt_func_info..cs&g|]}ˆ |¡p ˆ ˆ|ƒj¡‘qSr)rÚname)rÚc)rÚ sig_patternrr Ú Usþ z!opt_func_info..)Znumpy._core._multiarray_umathrrÚreÚcompileÚitemsÚany) Ú func_nameÚ signatureÚtargetsZmatching_funcsZ matching_sigsrr Zmatching_charsÚcharsr)rr rr r s*9  ÿ ý  )NN)Ú__doc__rÚ__all__rrrrr Ús