o
    1&i4                     @   s   d dl Z d dlZd dlmZ d dlmZ eddddd Zeddddd	 Zedd
dd Z	G dd deZ
dd Zdd ZdS )    N)njit)TestCaseT)Zparallelcachec                 C   s   | |    S N)sumarr r	   MC:\wamp64\www\opt\env\Lib\site-packages\numba/tests/parfors_cache_usecases.pyarrayexprs_case	      r   c                 C   s:   t | }d|   }t| jD ]
}| | | ||< q|S )N   )npZ
zeros_liker   rangesize)r   outcir	   r	   r
   prange_case   s
   
r   )r   c                 C   s   t t| S r   )r   r   r   r	   r	   r
   caller_case   r   r   c                   @   s    e Zd ZdZdd Zdd ZdS )_TestModulez
    Tests for functionality of this module's functions.
    Note this does not define any "test_*" method, instead check_module()
    should be called by hand.
    c                 C   s`   d}|j |j|jfD ]}td}tj|||| |t|j	j
7 }q
| j|ddd d S )Nr      z*At least one dispatcher has used the cache)msg)r   r   r   r   onestestingassert_allclosepy_funclenstatsZ
cache_hitsZassertGreater)selfmodZtotal_cache_hitsfnr   r	   r	   r
   check_module"   s   

z_TestModule.check_modulec                 C   s<   |j |j|jfD ]}td}tj|||| qd S )Nr   )r   r   r   r   r   r   r   r   )r   r    r!   r   r	   r	   r
   
run_module0   s   
z_TestModule.run_moduleN)__name__
__module____qualname____doc__r"   r#   r	   r	   r	   r
   r      s    r   c                  C      t jt } t |  d S r   )sysmodulesr$   r   r"   r    r	   r	   r
   	self_test;      
r,   c                  C   r(   r   )r)   r*   r$   r   r#   r+   r	   r	   r
   self_run@   r-   r.   )r)   numpyr   Znumbar   Znumba.tests.supportr   r   r   r   r   r,   r.   r	   r	   r	   r
   <module>   s    




