o
    1&i"                     @   s  d Z ddlZddlZddlZddlZdd Ze  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! 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=e<  ddl>Z>	 e= e_?dS )z5
Expose top-level symbols that are safe for import *
    Nc                  C   s   dd } t jdd }|dk r d|d  d|d	  d}t|ddl}| |}|d
k r=d|d  d|d	  d}t||dkrRd|d  d|d	  d}t|zddl}W n
 tyb   Y dS w | |}|dk rvd|j d}t|dS )a  
    Make sure the Python, NumPy and SciPy present are supported versions.
    This has to be done _before_ importing anything from Numba such that
    incompatible versions can be reported to the user. If this occurs _after_
    importing things from Numba and there's an issue in e.g. a Numba c-ext, a
    SystemError might have occurred which prevents reporting the likely cause of
    the problem (incompatible versions of critical dependencies).
    c                 S   s   t tt| jdd d S )N.   )tuplemapint__version__split)mod r
   9C:\wamp64\www\opt\env\Lib\site-packages\numba/__init__.pyextract_version   s   z._ensure_critical_deps.<locals>.extract_versionNr   )   
   z/Numba needs Python 3.10 or greater. Got Python r   r      )r      z-Numba needs NumPy 1.22 or greater. Got NumPy )r   r   z)Numba needs NumPy 2.3 or less. Got NumPy )r   r   z7Numba requires SciPy version 1.0 or greater. Got SciPy )sysversion_infoImportErrornumpyscipyr   )r   Z	PYVERSIONmsgnpZnumpy_versionr   Z
sp_versionr
   r
   r   _ensure_critical_deps   sJ   r   r   )get_versions)generate_version_infoversion)config)typeserrors)typeofprangepndindexgdbgdb_breakpointgdb_init	literallyliteral_unroll)*)cfunc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)Znumba.testingr;   main)argvkwdsZruntestsr
   r
   r   testw   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matchr   r   r   r   groups_min_llvmlite_versionr   warnZllvmlite.bindingrB   rC   _min_llvm_version)rD   rE   regexmverr   rB   rC   r
   r
   r   _ensure_llvm   s(   



rP   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winZsvml_dispmdFZhas_svmlx86_64z>SVML was found but llvmlite >= 0.23.2 is needed to support it.ZSVMLz-vector-library=SVMLTz'SVML was not found/could not be loaded.)r   ZDISABLE_INTEL_SVMLr   platform
startswithrE   ZbindingZload_library_permanentlygetattrtargetsAttributeErrormachineDEBUGrD   rK   Z
set_option)r   r
   r
   r   _try_enable_svml   s:   
r\   )@__doc__rU   rF   r   rD   r   _versionr   Znumba.misc.init_utilsr   r   r   Z
numba.corer   r   r   Znumba.misc.specialr   r    r!   r"   r#   r$   r%   r&   Znumba.core.errorsZnumba.core.typescoreZnumba.core.decoratorsr(   r)   r*   r+   r,   Znumba.np.ufuncr-   r.   r/   r0   r1   r2   r3   r4   Znumba.np.numpy_supportr5   r6   r7   Znumbar8   Znumba.core.withcontextsr9   Zobjmoder:   Znumba.core.target_extensionZnumba.typedr?   r   __all__rJ   rL   rP   r\   rE   Z
USING_SVMLr
   r
   r
   r   <module>   sT    .
((#/