
    uhh
                         d Z dgZddZdS )z!
Introspection helper functions.
opt_func_infoNc                   
 ddl }ddlm} ddlm
 | 6|                    |           fd|                                D             }n|}|v|                    |          i }|                                D ]I\  }}i }|                                D ]&\  }	}t          
fd|	D                       r|||	<   '|r|||<   Jn|}|S )am  
    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':

    >>> import numpy as np
    >>> 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)"
            }
          }
        }

        N)__cpu_targets_info__)dtypec                 F    i | ]\  }}                     |          ||S  )search).0kvfunc_patterns      K/var/www/histauto/venv/lib/python3.11/site-packages/numpy/lib/introspect.py
<dictcomp>z!opt_func_info.<locals>.<dictcomp>I   sC     
 
 
Q""1%%
q
 
 
    c              3      K   | ]<}                     |          p"                      |          j                  V  =d S )N)r	   name)r
   cr   sig_patterns     r   	<genexpr>z opt_func_info.<locals>.<genexpr>V   sb          &&q))N[-?-?a-N-N     r   )renumpy._core._multiarray_umathr   r   compileitemsany)	func_name	signaturer   targetsmatching_funcsmatching_sigsr   r   matching_charscharsr   r   r   s             @@@r   r   r      sO   t IIIMMMMMM333333zz),,
 
 
 
$]]__
 
 

 !jj++"((** 		2 		2DAqN"#'')) 4 4w     "     4 -4N5) 2#1a 		2 'r   )NN)__doc____all__r   r   r   r   <module>r$      s=     
W W W W W Wr   