ó
\K]c           @@ sī   d  d l  m Z m Z d  d l m Z m Z d  d l m Z d  d l m	 Z
 d  d l m Z m Z d  d l m Z e d  d e e f d	     Y Z e d
 k r° e
 j   n  d S(   i    (   t   print_functiont   absolute_import(   t   override_configt   TestCase(   t   skip_on_cudasim(   t   unittest_support(   t   cudat   types(   t   SerialMixins&   Simulator does not produce debug dumpst   TestCudaDebugInfoc           B@ s;   e  Z d  Z d   Z d   Z d   Z d   Z d   Z RS(   sH   
    These tests only checks the compiled PTX for debuginfo section
    c         C@ s   | j  |  | j |  S(   N(   t   compilet   inspect_asm(   t   selft   fnt   sig(    (    sE   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_debuginfo.pyt   _getasm   s    c         C@ sD   |  j  | d | } | r$ |  j n |  j } | d | d | d  S(   NR   s   .section .debug_info {t   msg(   R   t   assertInt   assertNotIn(   R   R   R   t   expectt   asmt   assertfn(    (    sE   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_debuginfo.pyt   _check   s    c         C@ s?   t  j d t  d    } |  j | d t j f d t d  S(   Nt   debugc         S@ s   d |  d <d  S(   Ni   i    (    (   t   x(    (    sE   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_debuginfo.pyt   foo   s    R   R   (   R   t   jitt   FalseR   R   t   int32(   R   R   (    (    sE   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_debuginfo.pyt   test_no_debuginfo_in_asm   s    c         C@ s?   t  j d t  d    } |  j | d t j f d t d  S(   NR   c         S@ s   d |  d <d  S(   Ni   i    (    (   R   (    (    sE   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_debuginfo.pyR       s    R   R   (   R   R   t   TrueR   R   R   (   R   R   (    (    sE   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_debuginfo.pyt   test_debuginfo_in_asm   s    c      
   C@ s   t  d d  r t j d    } |  j | d t j f d t t j d t  d    } |  j | d t j f d t Wd  QXd  S(   Nt   CUDA_DEBUGINFO_DEFAULTi   c         S@ s   d |  d <d  S(   Ni   i    (    (   R   (    (    sE   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_debuginfo.pyR   )   s    R   R   R   c         S@ s   d |  d <d  S(   Ni   i    (    (   R   (    (    sE   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_debuginfo.pyt   bar0   s    (   R   R   R   R   R   R   R   R   (   R   R   R!   (    (    sE   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_debuginfo.pyt   test_environment_override&   s
     (   t   __name__t
   __module__t   __doc__R   R   R   R   R"   (    (    (    sE   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_debuginfo.pyR	   
   s   				t   __main__N(   t
   __future__R    R   t   numba.tests.supportR   R   t   numba.cuda.testingR   t   numbaR   t   unittestR   R   R   R	   R#   t   main(    (    (    sE   lib/python2.7/site-packages/numba/cuda/tests/cudapy/test_debuginfo.pyt   <module>   s   ,