ó
\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 d d l m	 Z	 m
 Z
 m Z d e f d	     YZ d
 e f d     YZ e   Z d e	 j f d     YZ d e
 j f d     YZ e   Z e e d <d S(   i    (   t   print_functiont   divisiont   absolute_importNi   (   t   cpu(   t   TargetDescriptori   (   t
   dispatchert   utilst   typingt   _NestedContextc           B` s&   e  Z d Z d Z e j d     Z RS(   c         c` sG   |  j  |  j f } z | |  _  | |  _ d  VWd  | \ |  _  |  _ Xd  S(   N(   t   _typing_contextt   _target_context(   t   selft   typing_contextt   target_contextt
   old_nested(    (    s5   lib/python2.7/site-packages/numba/targets/registry.pyt   nested   s    			N(   t   __name__t
   __module__t   NoneR	   R
   t
   contextlibt   contextmanagerR   (    (    (    s5   lib/python2.7/site-packages/numba/targets/registry.pyR      s   t	   CPUTargetc           B` se   e  Z e j Z e   Z e j d     Z	 e j d    Z
 e d    Z e d    Z d   Z RS(   c         C` s   t  j |  j  S(   N(   R   t
   CPUContextR   (   R   (    (    s5   lib/python2.7/site-packages/numba/targets/registry.pyt   _toplevel_target_context   s    c         C` s
   t  j   S(   N(   R   t   Context(   R   (    (    s5   lib/python2.7/site-packages/numba/targets/registry.pyt   _toplevel_typing_context$   s    c         C` s'   |  j  j } | d k	 r | S|  j Sd S(   s5   
        The target context for CPU targets.
        N(   t   _nestedR
   R   R   (   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/registry.pyR   )   s    c         C` s'   |  j  j } | d k	 r | S|  j Sd S(   s5   
        The typing context for CPU targets.
        N(   R   R	   R   R   (   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/registry.pyR   4   s    c         C` s   |  j  j | |  S(   s   
        A context manager temporarily replacing the contexts with the
        given ones, for the current thread of execution.
        (   R   R   (   R   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/registry.pyt   nested_context?   s    (   R   R   R   t   CPUTargetOptionst   optionsR   R   R   t   cached_propertyR   R   t   propertyR   R   R   (    (    (    s5   lib/python2.7/site-packages/numba/targets/registry.pyR      s   		t   CPUDispatcherc           B` s   e  Z e Z RS(    (   R   R   t
   cpu_targett   targetdescr(    (    (    s5   lib/python2.7/site-packages/numba/targets/registry.pyR    K   s   t   TargetRegistryc           B` s    e  Z d  Z d   Z d   Z RS(   s1  
    A registry of API implementations for various backends.

    Attributes
    ----------
    ondemand:

        A dictionary of target-name -> function, where function is executed
        the first time a target is used.  It is used for deferred
        initialization for some targets (e.g. gpu).
    c         O` s,   t  t |   j | |   t j   |  _ d  S(   N(   t   superR#   t   __init__R   t
   UniqueDictt   ondemand(   R   t   argst   kws(    (    s5   lib/python2.7/site-packages/numba/targets/registry.pyR%   [   s    c         C` sF   | |  j  k r0 |  j  |   |  | <|  j  | =n  t t |   j |  S(   N(   R'   R$   R#   t   __getitem__(   R   t   item(    (    s5   lib/python2.7/site-packages/numba/targets/registry.pyR*   _   s    (   R   R   t   __doc__R%   R*   (    (    (    s5   lib/python2.7/site-packages/numba/targets/registry.pyR#   O   s   	R   (   t
   __future__R    R   R   R   t    R   t   descriptorsR   R   R   R   t   objectR   R   R!   t
   DispatcherR    R&   R#   t   dispatcher_registry(    (    (    s5   lib/python2.7/site-packages/numba/targets/registry.pyt   <module>   s   -		