
    
fn
                         d dl Zd dlZd dlZd dlZd dlZd dlZd dlm	Z	 d dl
mZmZ d dlZd Zd Z G d dej                  Zedk    r ej                     dS dS )	    N)jit)
needs_blasexpected_failure_py312c                 p    d}t          t          |                     D ]}|| |         ||         z  z  }|S )Nr   )rangelen)absumis       9lib/python3.11/site-packages/numba/tests/test_profiler.pydotr      s?    
C3q66]]  qtAaDyJ    c                 ,    t          j        | |          S N)npr   )r	   r
   s     r   np_dotr      s    6!Q<<r   c                   F    e Zd Zd Zed             Zed             Zd ZdS )TestProfilerc                    t          j        dt           j                  }t          j        dt           j                  } t          d          |          } |||           t	          j                    }|                                 	  |||           |                                 n# |                                 w xY wt          j	        |          
                                }|j        }t          j                            |j                  |j        |j        f}|                     ||j                   dS )zy
        Make sure the jit-compiled function shows up in the profile stats
        as a regular Python function.
           )dtypeT)nopythonN)r   arangefloat32r   profilerProfileenabledisablepstatsStats
strip_dirs__code__ospathbasenameco_filenameco_firstlinenoco_nameassertInstats)	selfpyfuncr	   r
   cfuncpr+   codeexpected_keys	            r   check_profiler_dotzTestProfiler.check_profiler_dot   s   
 Ib
+++Ib
+++"T"""6**a	


	E!QKKKIIKKKKAIIKKKKQ**,,(()9::+ 	lEK00000s   B/ /Cc                 :    |                      t                     d S r   )r2   r   )r,   s    r   test_profilerzTestProfiler.test_profiler2   s    $$$$$r   c                 L    d}t          j        t          j        d|g           d S )Na  if 1:
            import cProfile as profiler

            import numpy as np

            from numba import jit
            from numba.tests.test_profiler import np_dot

            cfunc = jit(nopython=True)(np_dot)

            a = np.arange(16, dtype=np.float32)
            b = np.arange(16, dtype=np.float32)

            p = profiler.Profile()
            p.enable()
            cfunc(a, b)
            cfunc(a, b)
            p.disable()
            -c
subprocess
check_callsys
executabler,   r0   s     r   test_profiler_np_dotz!TestProfiler.test_profiler_np_dot6   s+    & 	s~tT:;;;;;r   c                 L    d}t          j        t          j        d|g           d S )Na  if 1:
            import cProfile as profiler
            p = profiler.Profile()
            p.enable()

            from numba.tests.npyufunc.test_dufunc import TestDUFunc
            t = TestDUFunc('test_npm_call')
            t.test_npm_call()

            p.disable()
            r6   r7   r<   s     r   test_issue_3229zTestProfiler.test_issue_3229N   s+    
 	s~tT:;;;;;r   N)	__name__
__module____qualname__r2   r   r4   r   r=   r?    r   r   r   r      si        1 1 10 % % % < < Z<.< < < < <r   r   __main__)cProfiler   r$   r    r8   r:   numpyr   numbar   numba.tests.supportr   r   unittestr   r   TestCaser   r@   mainrC   r   r   <module>rL      s        				      



           B B B B B B B B     H< H< H< H< H<8$ H< H< H<T zHMOOOOO r   