U
    ?h                     @   sx   d dl Zd dlZd dlmZ d dlmZmZmZm	Z	 d dl
mZmZ dd Zdd ZG d	d
 d
eZedkrte  dS )    N)cuda)float32float64int32void)unittestCUDATestCasec                 C   s   t |\| d< |d< d S Nr   )mathfrexp)aryxaryexparg r   Z/var/www/html/venv/lib/python3.8/site-packages/numba/cuda/tests/cudapy/test_frexp_ldexp.pysimple_frexp   s    r   c                 C   s   t ||| d< d S r	   )r
   ldexp)r   r   expr   r   r   simple_ldexp   s    r   c                   @   s<   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd ZdS )TestCudaFrexpLdexpc                 C   s   t t|d d  td d  |t}d}tjd|d}tjdtjd}|d ||| tj||d | 	|d tj
}|d ||| tj||tj
 | 	|d tj}|d ||| tj||tj | 	|d d S )No!	@   Zdtyper   r   o!?   r   )r   jitr   r   r   npzerostestingassert_array_equalZassertEqualsinfnan)selfnptypenbtypecompiledr   r   r   r   r   r   template_test_frexp   s    &z&TestCudaFrexpLdexp.template_test_frexpc                 C   s   t t|d d  |tt}d}d}tjd|d}|d ||| tj||d tj	}|d ||| tj||tj	 tj
}|d ||| tj||tj
 d S )Nr   r   r   r   r   r   )r   r   r   r   r   r   r   r   r    r!   r"   )r#   r$   r%   r&   r   r   r   r   r   r   template_test_ldexp$   s    z&TestCudaFrexpLdexp.template_test_ldexpc                 C   s   |  tjt d S N)r'   r   r   r#   r   r   r   test_frexp_f44   s    z TestCudaFrexpLdexp.test_frexp_f4c                 C   s   |  tjt d S r)   )r(   r   r   r*   r   r   r   test_ldexp_f47   s    z TestCudaFrexpLdexp.test_ldexp_f4c                 C   s   |  tjt d S r)   )r'   r   r   r*   r   r   r   test_frexp_f8:   s    z TestCudaFrexpLdexp.test_frexp_f8c                 C   s   |  tjt d S r)   )r(   r   r   r*   r   r   r   test_ldexp_f8=   s    z TestCudaFrexpLdexp.test_ldexp_f8N)	__name__
__module____qualname__r'   r(   r+   r,   r-   r.   r   r   r   r   r      s   r   __main__)numpyr   r
   Znumbar   Znumba.typesr   r   r   r   Znumba.cuda.testingr   r   r   r   r   r/   mainr   r   r   r   <module>   s   1