o
    TdT!                     @   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!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l0m1Z1 ddl2Z0ddl2m3Z4 ddl2m5Z5 ddl6Z0ddl7Z0dd Z8d9 ej: ej: Z:d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rEtdzddl}W n
 tyU   Y dS w | |}|dk rid|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
   a/home/ncw/WWW/www-new/content/articles/pi-bbp/venv/lib/python3.10/site-packages/numba/__init__.pyextract_version   s   z._ensure_critical_deps.<locals>.extract_versionNr   )      z.Numba needs Python 3.8 or greater. Got Python r   r      )r      z-Numba needs NumPy 1.21 or greater. Got NumPy )r      zNumba needs NumPy 1.24 or less)r   r   z7Numba requires SciPy version 1.0 or greater. Got SciPy )sysversion_infoImportErrornumpyscipyr   )r   	PYVERSIONmsgnpnumpy_versionr   
sp_versionr
   r
   r   _ensure_critical_deps   s@   r   r   )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runtestsr
   r
   r   tests   s   rF   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   warnllvmlite.bindingrI   rJ   _min_llvm_version)rK   rL   regexmverr   rI   rJ   r
   r
   r   _ensure_llvm   s(   



rX   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_SVMLr   platform
startswithrL   bindingload_library_permanentlygetattrtargetsAttributeErrormachineDEBUGrK   rR   
set_option)r   r
   r
   r   _try_enable_svml   s:   
rk   )A__doc__ra   rM   r   rK   r   _versionr   numba.misc.init_utilsr   r   r   
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/   r0   r1   numba.np.ufuncr2   r3   r4   r5   r6   r7   r8   r9   numba.np.numpy_supportr:   r;   r<   numbar=   numba.core.withcontextsr>   objmoder?   numba.core.target_extensionnumba.typedrF   r   __all__rQ   rT   rX   rk   rL   
USING_SVMLr
   r
   r
   r   <module>   sT    *
( (#/