U
    ,d                     @   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)parallelcachec                 C   s   | |    S N)sumarr r
   F/tmp/pip-unpacked-wheel-eu7e0c37/numba/tests/parfors_cache_usecases.pyarrayexprs_case	   s    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   s    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 ]6}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   s   t jt } t |  d S r   )sysmodulesr$   r   r"   r    r
   r
   r   	self_test;   s    
r+   c                  C   s   t jt } t |  d S r   )r(   r)   r$   r   r#   r*   r
   r
   r   self_run@   s    
r,   )r(   Znumpyr   Znumbar   Znumba.tests.supportr   r   r   r   r   r+   r,   r
   r
   r
   r   <module>   s   




