ó
\K]c           @` s;  d  d l  m Z m Z m Z d  d l m Z m Z d  d l m Z m	 Z	 m
 Z
 m Z d  d l m Z d d l m Z e ƒ  Z e j Z e j e j d ƒ ƒ Z e j d „  ƒ Z e j e j ƒ e j e j ƒ d	 „  ƒ ƒ Z e j e j ƒ d
 „  ƒ Z e j e j ƒ d „  ƒ Z e e e j  e j! ƒ ƒ d „  ƒ Z" d S(   i    (   t   print_functiont   absolute_importt   division(   t   Typet   Constant(   t   typest   typingt   cgutilst   utils(   t   Registryi   (   t	   nvvmutilsi   c         C` s   t  d |  f ƒ ‚ d S(   sµ   
    Handle printing of a single value of the given Numba type.
    A (format string, [list of arguments]) is returned that will allow
    forming the final printf()-like call.
    s,   printing unimplemented for values of type %sN(   t   NotImplementedError(   t   tyt   contextt   buildert   val(    (    s3   lib/python2.7/site-packages/numba/cuda/printimpl.pyt
   print_item   s    c         C` sg   |  t  j k r! d } t  j } n d } t  j } | j | | ƒ } | j | | |  | ƒ } | | g f S(   Ns   %llus   %lld(   R   t   unsigned_domaint   uint64t   int64t   insert_string_const_addrspacet   cast(   R   R   R   R   t   rawfmtt   dsttypet   fmtt   lld(    (    s3   lib/python2.7/site-packages/numba/cuda/printimpl.pyt   int_print_impl   s    	c         C` s(   | j  | | |  t j ƒ } d | g f S(   Ns   %f(   R   R   t   float64(   R   R   R   R   R   (    (    s3   lib/python2.7/site-packages/numba/cuda/printimpl.pyt   real_print_impl)   s    c         C` sC   |  j  } t | t ƒ s t ‚ d } | j | | ƒ } | | g f S(   Ns   %s(   t   literal_valuet
   isinstancet   strt   AssertionErrorR   (   R   R   R   t   sigvalt   pyvalR   R   (    (    s3   lib/python2.7/site-packages/numba/cuda/printimpl.pyt   const_print_impl.   s
    	c         C` s	  t  j | j ƒ } g  } g  } xa t t | j | ƒ ƒ D]G \ } \ } }	 t | |  | |	 ƒ \ }
 } | j |
 ƒ | j | ƒ q7 Wd j	 | ƒ d } |  j
 | | ƒ } t j | | ƒ } t j | | ƒ } t  j | j ƒ } | j | | | j | t ƒ f ƒ |  j ƒ  S(   s½   This function is a generic 'print' wrapper for arbitrary types.
    It dispatches to the appropriate 'print' implementations above
    depending on the detected real types in the signature.t    s   
(   R
   t   declare_vprintt   modulet	   enumeratet   zipt   argsR   t   appendt   extendt   joinR   R   t   make_anonymous_structt   alloca_once_valuet   callt   bitcastt   voidptrt   get_dummy_value(   R   R   t   sigR)   t   vprintt   formatst   valuest   it   argtypet   argvalt   argfmtt   argvalsR   R   t   arrayt   arrayptr(    (    s3   lib/python2.7/site-packages/numba/cuda/printimpl.pyt   print_varargs7   s    +"N(#   t
   __future__R    R   R   t   llvmlite.llvmpy.coreR   R   t   numbaR   R   R   R   t   numba.targets.imputilsR	   t    R
   t   registryt   lowert   pointert   intR1   t   singledispatchR   t   registert   Integert   IntegerLiteralR   t   FloatR   t   StringLiteralR#   t   printt   VarArgt   AnyR>   (    (    (    s3   lib/python2.7/site-packages/numba/cuda/printimpl.pyt   <module>   s   "			