o
    
j                     @   s&   d dl Z d dlZd dlZdddZdS )    NFc                    sL   t jdstd d S d |h}d	dd  fdd|D }dd |D S )
Nlinuxz(find_cudart_versions only works on Linuxc                 S   s|   d}| r
|d |  }z)t |}t|j_t t jg|j_t  }|t |}|dkr0W d S W |j
S  t	y=   Y d S w )Nzlibcudart.so.r   )ctypesCDLLintcudaRuntimeGetVersionrestypePOINTERc_intargtypesbyref	Exceptionvalue)find_cudart_versioncudart_lib_filenamecudartversionstatus r   b/home/kuhnn/.local/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_collect_build_info.pyget_cudart_version   s    
z0find_cudart_versions.<locals>.get_cudart_versionc                    s   h | ]} |qS r   r   ).0cudart_versionr   r   r   	<setcomp>,       z'find_cudart_versions.<locals>.<setcomp>c                 S   s   g | ]}|r|qS r   r   )r   verr   r   r   
<listcomp>/   r   z(find_cudart_versions.<locals>.<listcomp>)N)sysplatform
startswithwarningswarn)	build_envbuild_cuda_versioncudart_possible_versionscudart_found_versionsr   r   r   find_cudart_versions
   s   	

r'   )FN)r   r   r!   r'   r   r   r   r   <module>   s   