B
    l‚z]s  ã               @   s   d d„ Z dS )c              C   s   ddl } |  ¡ }|dkr"ddg}n(|dkr6ddd	g}n|d
krFdg}ndS ddl}|d
krb|j}n|j}d}x*|D ]"}y| |¡}P W qr   Y qrX qrW |dkr¤dS yl|j}| d¡}||ƒ}	|	dkrÊdS |j}
| 	d¡}|
| 
|¡ƒ}	|	dkrôdS |j}d|d |d d f S    dS dS )aÛ  Attempt to detect the version of CUDA present in the operating system.

    On Windows and Linux, the CUDA library is installed by the NVIDIA
    driver package, and is typically found in the standard library path,
    rather than with the CUDA SDK (which is optional for running CUDA apps).

    On macOS, the CUDA library is only installed with the CUDA SDK, and
    might not be in the library path.

    Returns: version string (Ex: '9.2') or None if CUDA not found.
    é    NZDarwinzlibcuda.dylibz!/usr/local/cuda/lib/libcuda.dylibZLinuxz
libcuda.soz/usr/lib64/nvidia/libcuda.soz$/usr/lib/x86_64-linux-gnu/libcuda.soZWindowsz
nvcuda.dllz%d.%diè  é
   )ÚplatformÚsystemÚctypesZwindllZcdllZLoadLibraryÚcuInitZc_uintÚcuDriverGetVersionZc_intZbyrefÚvalue)r   r   Zlib_filenamesr   ZdllZlibcudaZlib_filenamer   ÚflagsZretr   Zversion_intr   © r
   ú0lib/python3.7/site-packages/conda/common/cuda.pyÚcuda_detect   sP    




r   N)r   r
   r
   r
   r   Ú<module>   ó    