
    J/Ph                         d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZm	Z	  G d de          Z
edk    r ej                     dS dS )    N)dedent)TemporaryDirectory)TestCaserun_in_subprocessc                       e Zd ZdZd ZdS )TestChromeTraceModulez0
    Test chrome tracing generated file(s).
    c           	      z   d}t          |          }t                      5 }t          j                            |d          }t          j                                        }||d<   t          ||           t          |          5 }t          j
        |          }|                     |t                     |D ]T}|                     |t                     |                     t          |                                          h d           U	 d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )NaY  
            from numba import njit
            import numpy as np

            x = np.arange(100).reshape(10, 10)

            @njit
            def go_fast(a):
                trace = 0.0
                for i in range(a.shape[0]):
                    trace += np.tanh(a[i, i])
                return a + trace

            go_fast(x)
        ztest_trace.jsonNUMBA_CHROME_TRACE)env>   phtscatpidtidargsname)r   r   ospathjoinenvironcopyr   openjsonloadassertIsInstancelistdictassertEqualsetkeys)	selfcodesrctmpdirr   r   fileeventsevs	            ]/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numba/tests/test_chrome_trace.pytest_trace_outputz'TestChromeTraceModule.test_trace_output   s     Tll!! 	V7<<(9::D*//##C(,C$%cs++++d 	t4%%fd333   B))"d333$$BGGIIIII   	 	 	 	 	 	 	 	 	 	 	 	 	 	 		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s7   A$D0BDD0D	D0D	 D00D47D4N)__name__
__module____qualname____doc__r)        r(   r   r   
   s-                  r/   r   __main__)r   r   unittesttextwrapr   tempfiler   numba.tests.supportr   r   r   r*   mainr.   r/   r(   <module>r6      s    				         ' ' ' ' ' ' ; ; ; ; ; ; ; ;% % % % %H % % %P zHMOOOOO r/   