o
    8Î®cT  ã                   @   s®  d Z ddlZddlZddlZddlZddlmZ ddlmZ eƒ d Z	ee	ƒZ
[[ddlmZ ddlmZmZ dd	lmZmZmZmZmZmZmZmZ dd
lT ddlm  mZ dd
lT ddlmZmZmZmZm Z m!Z! ddl"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z* ddl+m,Z,m-Z-m.Z. ddl/m0Z0 ddl1Z/ddl1m2Z3 ddl1m4Z4 ddl5Z/ddl6Z/dd„ Z7d 8¡ ej9 ej9 Z9dZ:dZ;dd„ Z<dd„ Z=dd„ Z>e<ƒ  e=ƒ  ddl?Z?	 e>ƒ e_@dS )z5
Expose top-level symbols that are safe for import *
é    Né   )Úget_versions)Úgenerate_version_infoÚversion)Úconfig)ÚtypesÚerrors)ÚtypeofÚprangeÚpndindexÚgdbÚgdb_breakpointÚgdb_initÚ	literallyÚliteral_unroll)Ú*)ÚcfuncÚgenerated_jitÚjitÚnjitÚstencilÚ
jit_module)Ú	vectorizeÚguvectorizeÚthreading_layerÚget_num_threadsÚset_num_threadsÚset_parallel_chunksizeÚget_parallel_chunksizeÚget_thread_id)ÚcarrayÚfarrayÚ
from_dtype)Úexperimental)Úobjmode_context)Úparallel_chunksizec                 K   s   ddl m} |j| fi |¤ŽS )Nr   )Ú	_runtests)Únumba.testingr&   Úmain)ÚargvÚkwdsÚruntests© r,   ú5/tmp/pip-target-vg8gfxp4/lib/python/numba/__init__.pyÚtestA   s   r.   aK  
    cfunc
    from_dtype
    guvectorize
    jit
    experimental
    njit
    stencil
    jit_module
    typeof
    prange
    gdb
    gdb_breakpoint
    gdb_init
    vectorize
    objmode
    literal_unroll
    get_num_threads
    set_num_threads
    set_parallel_chunksize
    get_parallel_chunksize
    parallel_chunksize
    )r   é'   r   )é   r   r   c                  C   sž   ddl } ddl}t d¡}| |j¡}|r/ttt| 	¡ ƒƒ}|t
k r.dt
|jf  }t|ƒ‚n|  d¡ ddlm}m} |tk rJdt|  }t|ƒ‚|ƒ  dS )z,
    Make sure llvmlite is operational.
    r   Nz(\d+)\.(\d+).(\d+)zfNumba requires at least version %d.%d.%d of llvmlite.
Installed version is %s.
Please update llvmlite.z'llvmlite version format not recognized!)Úllvm_version_infoÚcheck_jit_executionzNumba requires at least version %d.%d.%d of LLVM.
Installed llvmlite is built against version %d.%d.%d.
Please update llvmlite.)ÚwarningsÚllvmliteÚreÚcompileÚmatchÚ__version__ÚtupleÚmapÚintÚgroupsÚ_min_llvmlite_versionÚImportErrorÚwarnÚllvmlite.bindingr1   r2   Ú_min_llvm_version)r3   r4   ÚregexÚmÚverÚmsgr1   r2   r,   r,   r-   Ú_ensure_llvmc   s(   

ýû
ý
rF   c                  C   sœ   ddl m}  ddlm} |dk rtdƒ‚| dk rtdƒ‚| dkr$td	ƒ‚zdd
l}W n
 ty4   Y d
S w ttt|j	 
d¡d
d… ƒƒ}|dk rLtdƒ‚d
S )zD
    Make sure Python, NumPy and SciPy have supported versions.
    r   )Únumpy_version)Ú	PYVERSION)é   é   z!Numba needs Python 3.7 or greater)r   é   z!Numba needs NumPy 1.18 or greater)r   é   zNumba needs NumPy 1.23 or lessNÚ.é   )r   r   z+Numba requires SciPy version 1.0 or greater)Únumba.np.numpy_supportrG   Únumba.core.utilsrH   r>   Úscipyr9   r:   r;   r8   Úsplit)rG   rH   rQ   Ú
sp_versionr,   r,   r-   Ú_ensure_critical_deps…   s"   ÿÿrT   c                  C   sü   t js|z^tj d¡rtj d¡ ntj d¡rtj d¡ ntj d¡r+tj d¡ nW dS zttjj	dƒƒ s;W W dS W n t
yW   t ¡ d	krSt jrSd
} t | ¡ Y W dS w tj dd¡ W dS    t ¡ d	krvt jryt d¡ Y dS Y dS Y dS dS )zU
    Tries to enable SVML if configuration permits use and the library is found.
    Úlinuxz
libsvml.soÚdarwinzlibsvml.dylibÚwinÚsvml_dispmdFÚhas_svmlÚx86_64z>SVML was found but llvmlite >= 0.23.2 is needed to support it.ÚSVMLz-vector-library=SVMLTz'SVML was not found/could not be loaded.)r   ÚDISABLE_INTEL_SVMLÚsysÚplatformÚ
startswithr4   ÚbindingÚload_library_permanentlyÚgetattrÚtargetsÚAttributeErrorÚmachineÚDEBUGr3   r?   Ú
set_option)rE   r,   r,   r-   Ú_try_enable_svmlž   s:   ý
ùþþrh   )AÚ__doc__r^   r5   r]   r3   Ú_versionr   Únumba.misc.init_utilsr   r8   Úversion_infoÚ
numba.corer   r   r   Únumba.misc.specialr	   r
   r   r   r   r   r   r   Únumba.core.errorsÚnumba.core.typesÚcoreÚnumba.core.decoratorsr   r   r   r   r   r   Únumba.np.ufuncr   r   r   r   r   r   r   r   rO   r    r!   r"   Únumbar#   Únumba.core.withcontextsr$   Úobjmoder%   Únumba.core.target_extensionÚnumba.typedr.   rR   Ú__all__r=   rA   rF   rT   rh   r4   Ú
USING_SVMLr,   r,   r,   r-   Ú<module>   sT    
( (êê"/