ó
\K]c           @` sk   d  d l  m Z m Z m Z d  d l Z d  d l Z d  d l Z d  d l Z d „  Z d „  Z	 d „  Z
 d S(   i    (   t   print_functiont   divisiont   absolute_importNc    J   	   C` s|  d d  l  }  d d  l } d d  l } d d l m } d d l m } d d l m } d d l m	 } d d l m
 } d d l m } m }	 d d  l }
 d d  l } d d  l j } d d  l } d d l m } d d	 l m } d d
 l m } m } zsy;d } t d d ƒ t d ƒ t | j ƒ  ƒ t d ƒ t d ƒ |  j ƒ  } t | d |  j ƒ  f ƒ t | d | j ƒ  f ƒ | d k rwd } yd } t | d ƒ ð } | j ƒ  j  ƒ  } xÔ | D]Ì } | j! | ƒ rÁ| j! d | ƒ rGd | j" d ƒ d j# ƒ  } t$ | d ƒ } t% t& | ƒ j' d ƒ ƒ } t | d | f ƒ q| j! d | ƒ r| j" d ƒ d j# ƒ  } t | d | f ƒ qqÁqÁWWd  QXWn+ t( k
 rÅt | d  | j) ƒ  f ƒ n XyŒ d! „  } d" } t$ | | ƒ d ƒ } d# } t$ | | ƒ d ƒ } | d$ k r't | d ƒ n* t* | ƒ t* | ƒ }  t | d' |  f ƒ Wq‘t( k
 rst | dŽ ƒ q‘Xn t | d  | j) ƒ  f ƒ y | j+ ƒ  }! Wn t, k
 rÂt | d ƒ ne Xt- g  |! j. ƒ  D] \ }" }# |# rÓ|" ^ qÓƒ }$ |
 j/ d+ j0 |$ ƒ d ƒ }% t | d ƒ t |% ƒ t d ƒ t d, ƒ t | d- |  j  d. t1 ƒ f ƒ t | d/ |  j2 ƒ  f ƒ t | d0 | f ƒ t | d1 |  j3 ƒ  f ƒ yê | d k rÁ|  j4 ƒ  }& nB | d2 k rÜ|  j5 ƒ  }& n' | d3 k r÷|  j6 ƒ  }& n t, d4 ƒ ‚ d j0 g  t7 | j8 |& ƒ ƒ D] } | d k r7| n d+ ^ qƒ }' t | d5 |' f ƒ | d k rŒt | d6 d+ j0 |  j9 ƒ  ƒ f ƒ n  Wn t d7 ƒ n Xt d ƒ t d8 ƒ t | d9 |  j: ƒ  f ƒ t | d: |  j; ƒ  f ƒ t | d; |  j< ƒ  f ƒ g  }( y7 x0 | j= ƒ  D]" } | d  k	 r|( j? | ƒ qqWWn& t( k
 rh}) |( j? t% |) ƒ ƒ n Xt | d< d+ j0 |( ƒ f ƒ t d ƒ t d= ƒ t | d> d? j0 g  | j@ D] }* t% |* ƒ ^ q³ƒ f ƒ t d ƒ t d@ ƒ y | jA ƒ  d WnÀ t( k
 r»}) dA }+ dB }, dC }- dD }. tB |) dE d  ƒ }/ |/ d  k	 r„|+ |/ k rZ|+ |- }0 q˜|, |/ k rs|, |- }0 q˜|. dF |/ }0 n |. d+ t% |) ƒ }0 t dG |0 t% tC |) ƒ ƒ f ƒ n‚ Xym | jD ƒ  | jE d ƒ }1 | jF | jG |1 ƒ ƒ t | dH |1 jH f ƒ t dI ƒ | jI jJ tK j  dJ tL ƒWn t dK ƒ n Xt d ƒ t dL ƒ | jM ƒ  }2 t | dM |2 f ƒ g  }3 y |	 jN ƒ  |3 j? dN ƒ Wn n Xy# | jO ƒ  jP ƒ  }4 |3 j? dO ƒ Wn n X|2 s)	d dP lQ mR }5 y |5 jM Wn t( k
 r	}) t% |) ƒ }/ n XdQ }/ t | dR |/ f ƒ n  |3 rO	t | dS dT j0 |3 ƒ f ƒ n  y d dU lQ mR }5 mS }6 dV „  }7 t dW tT |5 jU ƒ ƒ xt tV |5 jU ƒ D]c \ }8 }9 t dX |8 ƒ t dY |7 |9 jW ƒ ƒ t dZ |7 |9 jX ƒ ƒ t d[ |9 jY ƒ t d ƒ q˜	Wg  }: xB |5 jU D]7 }; |; jZ r
|; jY d\ k r
|: j? |7 |; jX ƒ ƒ q
q
Wt | d] |6 ƒ  dT j0 |: ƒ f ƒ Wn' t[ k
 r˜
}) t d^ ƒ t |) ƒ n Xt d ƒ t d_ ƒ t1 }< yp tK j  j! d` ƒ rØ
| j\ da ƒ nJ tK j  j! db ƒ rú
| j\ dc ƒ n( tK j  j! dd ƒ r| j\ de ƒ n tL }< Wn tL }< n XtB | j] df d  ƒ }= |= d  k	 r]|= ƒ  n tL }> | j^ ou|> ou|< }? t | dg | j^ f ƒ t | dh |< f ƒ t | di |> f ƒ t | dj |? f ƒ t d ƒ t dk ƒ dl „  }@ y( d dm l_ m` }A t | dn t1 f ƒ WnD ta k
 rV}) t | dn tL f ƒ t | do |@ |) dp ƒ f ƒ n Xy( d dq l_ mb }B t | dr t1 f ƒ WnD ta k
 rÅ}) t | dr tL f ƒ t | do |@ |) ds ƒ f ƒ n Xy( d dt l_ mc }C t | du t1 f ƒ WnD ta k
 r4}) t | du tL f ƒ t | do |@ |) dv ƒ f ƒ n Xt d ƒ t dw ƒ tL }D xI td je j. ƒ  D]8 \ }* }E |* j! dx ƒ r_t | |* |E f ƒ t1 }D q_q_W|D s®t dy ƒ n  t d ƒ t dz ƒ d{ d| d} g }4 y | |4 ƒ }F Wn! t[ k
 r}) t d~ |) ƒ nXd j0 |F jf d ƒ j  ƒ  ƒ }G | jg |G ƒ }H d€ d d‚ dƒ d„ g }I x> |I D]6 }* y t | |* |H |* f ƒ WqNth k
 rƒqNXqNWd{ d… g }4 y | |4 ƒ }F Wn$ | k
 rÊ}) t d† |) ji ƒ nX Xt d ƒ t d‡ ƒ |F jf d ƒ j  ƒ  }G x+ |G D]# }* |* d dˆ k rût |* ƒ qûqûWt d d ƒ Wn1 t[ k
 rd}) t d‰ ƒ t dŠ ƒ t |) ƒ n XWd  t d‹ dŒ ƒ Xd  S(‘   Ni    (   t   config(   t   cuda(   t   cudadrv(   t   driver(   t   roc(   t   hlct   libhlc(   t   datetime(   t   chain(   t   check_outputt   CalledProcessErrors   %-45s : %-st   -iP   s   __Time Stamp__t    s   __Hardware Information__t   Machines   CPU Namet   Linuxt   Cpus_alloweds   /proc/self/statust   rts   %s:s   0x%st   :i   i   t   1s   Number of accessible CPU coress   %s_list:s   Listed accessible CPUs coress	   CPU countc         S` s,   t  |  d ƒ  } | j ƒ  j ƒ  SWd  QXd  S(   NR   (   t   opent   readt
   splitlines(   t   loct   f(    (    s0   lib/python2.7/site-packages/numba/numba_entry.pyt   scrape_lines?   s    s(   /sys/fs/cgroup/cpuacct/cpu.cfs_period_uss'   /sys/fs/cgroup/cpuacct/cpu.cfs_quota_usiÿÿÿÿs   CFS restrictionst   Nones(   CFS restrictions (CPUs worth of runtime)s   Information not availables   CPU Featurest   NAt    s   __OS Information__t   Platformt   aliasedt   Releases   System Namet   Versiont   Windowst   Darwins   Unknown system.s   OS specific infos
   glibc infos5   Error: System name incorrectly identified or unknown.s   __Python Information__s   Python Compilers   Python Implementations   Python Versions   Python Locale s   __LLVM information__s   LLVM versiont   .s   __CUDA Information__s#   CUDA driver library cannot be founds   CUDA is disableds(    or no CUDA enabled devices are present.s)   Error: CUDA device intialisation problem.t   msgs	    Message:s   %s
Error class: %ss   CUDA driver versions   CUDA libraries:t   print_pathssI   Error: Probing CUDA failed (device and driver present, runtime problem?)
s   __ROC Information__s   ROC availables   librocmlite librarys   ROC command line tools(   t   hsas   No ROC toolchains found.s   Error initialising ROC due tos   Available Toolchainss   , (   R(   t
   dgpu_countc         S` s    t  |  t ƒ r |  j d ƒ S|  S(   Ns   utf-8(   t
   isinstancet   bytest   decode(   t   x(    (    s0   lib/python2.7/site-packages/numba/numba_entry.pyt   <lambda>Ò   R   s   
Found %s HSA Agents:s   Agent id  : %ss       vendor: %ss         name: %ss         type: %st   GPUs   Found %s discrete GPU(s)s:   No HSA Agents found, encountered exception when searching:s   __SVML Information__t   linuxs
   libsvml.sot   darwins   libsvml.dylibt   wint   svml_dispmdt   has_svmls   SVML state, config.USING_SVMLs   SVML library found and loadeds    llvmlite using SVML patched LLVMs   SVML operationals   __Threading Layer Information__c         S` s€   yh g  |  j  j d ƒ D] } | j ƒ  ^ q \ } } } t j j | ƒ d } | | k rg d | | f SWn t k
 r{ n Xd S(   NR   i   s   %s: %ss   Unknown import problem.(   R&   t   splitt   stript   ost   patht   BaseException(   t   et   backendR-   R8   t   problemt   symbolt   extn_dso(    (    s0   lib/python2.7/site-packages/numba/numba_entry.pyt   parse_error  s    4(   t   tbbpools   TBB Threading layer availables   +--> Disabled due toR@   (   t   omppools    OpenMP Threading layer availableRA   (   t	   workqueues#   Workqueue Threading layer availableRB   s*   __Numba Environment Variable Information__t   NUMBA_s	   None set.s   __Conda Information__t   condat   infos   --jsons,   Conda not present/not working.
Error was %s
s   utf-8t   conda_build_versiont   conda_env_versiont   platformt   python_versiont   root_writablet   lists*   Error: Conda command failed. Error was %s
s   __Current Conda Env__t   #s9   Error: The system reporting tool has failed unexpectedly.s   Exception was:s   %ssµ  If requested, please copy and paste the information between
the dashed (----) lines, or from a given specific section as
appropriate.

=============================================================
IMPORTANT: Please ensure that you are happy with sharing the
contents of the information present, any information that you
wish to keep private you should remove before sharing.
=============================================================
(   s   CFS restrictionsR   (   s   CFS restrictionss   Information not available(   s   CPU FeaturesR   (   s   CPU FeaturesR   (j   RH   t   jsont   multiprocessingt   numbaR   R   t
   numba.cudaR   t   numba.cuda.cudadrv.driverR   R   t   numba.roc.hlcR   R	   t   textwrapt   ctypest   llvmlite.bindingt   bindingt   localeR
   t	   itertoolsR   t
   subprocessR   R   t   printt   utcnowt   systemt   machinet   get_host_cpu_nameR   R   R   t
   startswithR5   R6   t   intt   strt   bint   countR9   t	   cpu_countt   floatt   get_host_cpu_featurest   RuntimeErrort   sortedt   itemst   fillt   joint   Truet   releaset   versiont   linux_distributiont	   win32_vert   mac_verRK   t   from_iterablet   libc_vert   python_compilert   python_implementationRI   t   getdefaultlocaleR   t   appendt   llvm_version_infot   list_devicest   getattrt   typet   detectt   c_intt   cuDriverGetVersiont   byreft   valuet   libst   testt   syst   Falset   is_availablet   HLCt   CmdLinet   check_toolingt   numba.roc.hsadrv.driverR(   R)   t   lent   agentst	   enumeratet   vendor_namet   namet   devicet   is_componentt	   Exceptiont   load_library_permanentlyt   targetst
   USING_SVMLt   numba.npyufuncR@   t   ImportErrorRA   RB   R7   t   environR,   t   loadst   KeyErrort   output(J   RH   RM   RN   R   t   cuR   t   cudriverR   R   R	   t   twt   ctt   llvmbindRW   R
   R   R   R   t   fmtt   system_namet   strmatchR   R   t	   proc_statR-   t   hexnumt   acc_cpust   _nt   _aR   t
   cfs_periodt	   cfs_quotat   runtime_amountt
   featuremapt   keyR€   t   featurest   cpu_featRE   t   buft   lclR:   t   kt   msg_not_foundt   msg_disabled_by_usert   msg_endt   msg_generic_problemR&   t   err_msgt   dvt   roc_is_availablet
   toolchainst   cmdR(   R)   R,   t   it   agentt   _dgpust   at   have_svml_libraryt   funct   llvm_svml_patchedt   svml_operationalR?   R@   RA   RB   t   _envvar_foundt   vt	   conda_outt   datat   jsondt   keys(    (    s0   lib/python2.7/site-packages/numba/numba_entry.pyt   get_sys_info	   s,    


				


 	:*



	*

$




 	






				



	



c          C` sô   t  j ƒ  }  |  j d d d d d ƒ|  j d d d d d ƒ|  j d d d d d	 ƒ|  j d
 d d d d ƒ|  j d d d d d ƒ|  j d d d d d ƒ|  j d d d d d ƒ|  j d d d d d d ƒ|  j d d d d d ƒ|  S(   Ns
   --annotatet   helps   Annotate sourcet   actiont
   store_trues   --dump-llvms   Print generated llvm assemblys   --dump-optimizeds    Dump the optimized llvm assemblys   --dump-assemblys    Dump the LLVM generated assemblys
   --dump-cfgs(   [Deprecated] Dump the control flow graphs
   --dump-asts   [Deprecated] Dump the ASTs   --annotate-htmlt   nargsi   s    Output source annotation as htmls   -ss	   --sysinfos+   Output system information for bug reportingt   filenamet   ?s   Python source filename(   t   argparset   ArgumentParsert   add_argument(   t   parser(    (    s0   lib/python2.7/site-packages/numba/numba_entry.pyt   make_parserl  s&    c          C` s›  t  ƒ  }  |  j ƒ  } | j r8 t d ƒ t j d ƒ n  | j r[ t d ƒ t j d ƒ n  | j r… t d ƒ t ƒ  t j d ƒ n  t	 t
 | j ƒ ƒ t j d <| j d  k	 ry d d l m } Wn t k
 rã t d ƒ ‚ n Xt	 | j d ƒ t j d	 <n  t	 t
 | j ƒ ƒ t j d
 <t	 t
 | j ƒ ƒ t j d <t	 t
 | j ƒ ƒ t j d <| j r€t j | j g } t j | ƒ n t d ƒ t j d ƒ d  S(   Ns   CFG dump is removed.i   s5   AST dump is removed.  Numba no longer depends on AST.s   System info:i    t   NUMBA_DUMP_ANNOTATION(   t   Templates#   Please install the 'jinja2' packaget   NUMBA_DUMP_HTMLt   NUMBA_DUMP_LLVMt   NUMBA_DUMP_OPTIMIZEDt   NUMBA_DUMP_ASSEMBLYs<   numba: error: the following arguments are required: filename(   RÔ   t
   parse_argst   dump_cfgRZ   Rƒ   t   exitt   dump_astt   sysinfoRÉ   Ra   R`   t   annotateR7   R—   t   annotate_htmlR   t   jinja2RÖ   R–   t	   dump_llvmt   dump_optimizedt   dump_assemblyRÎ   t
   executableRY   t   call(   RÓ   t   argsRÖ   Rº   (    (    s0   lib/python2.7/site-packages/numba/numba_entry.pyt   main‚  s6    		
	
	
	
(   t
   __future__R    R   R   Rƒ   RÐ   R7   RY   RÉ   RÔ   Ré   (    (    (    s0   lib/python2.7/site-packages/numba/numba_entry.pyt   <module>   s   	ÿ d	