ó
\K]c           @` s—   d  d l  m Z m Z m Z d  d l Z d  d l m Z d  d l m	 Z	 m
 Z
 d  d l m Z d e e j f d „  ƒ  YZ e d k r“ e j ƒ  n  d S(	   i    (   t   print_functiont   absolute_importt   divisionN(   t   unittest_support(   t   cudat   float32(   t   SerialMixint   TestFastMathOptionc           B` s   e  Z d  „  Z d „  Z RS(   c         C` sc   d „  } t  j d d t ƒ| ƒ } t  j d ƒ | ƒ } |  j d | j ƒ |  j d | j ƒ d  S(   Nc         S` s9   t  j d ƒ } | |  j k  r5 t | ƒ | |  | <n  d  S(   Ni   (   R   t   gridt   sizeR   (   t   arrt   valt   i(    (    sD   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_fastmath.pyt   foo   s    s   void(float32[:], float32)t   fastmaths   div.full.ftz.f32(   R   t   jitt   Truet   assertInt   ptxt   assertNotIn(   t   selfR   t   fastvert   precver(    (    sD   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_fastmath.pyt   test_kernel   s
    	c         ` s‡   t  j d d t ƒd „  ƒ ‰  ‡  f d †  } t  j d d t ƒ| ƒ } t  j d ƒ | ƒ } |  j d | j ƒ |  j d | j ƒ d  S(   Ns   float32(float32, float32)t   devicec         S` s   |  | S(   N(    (   t   at   b(    (    sD   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_fastmath.pyR      s    c         ` s8   t  j d ƒ } | |  j k  r4 ˆ  | | ƒ |  | <n  d  S(   Ni   (   R   R   R	   (   R
   R   R   (   R   (    sD   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_fastmath.pyt   bar   s    s   void(float32[:], float32)R   s   div.full.ftz.f32(   R   R   R   R   R   R   (   R   R   R   R   (    (   R   sD   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_fastmath.pyt   test_device   s    (   t   __name__t
   __module__R   R   (    (    (    sD   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_fastmath.pyR   
   s   	t   __main__(   t
   __future__R    R   R   t   numpyt   npt   numbaR   t   unittestR   R   t   numba.cuda.testingR   t   TestCaseR   R   t   main(    (    (    sD   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_fastmath.pyt   <module>   s    