+
     þÎj+  ã                   óÚ   € ^ RI t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHtH	t	 ]! RRR.4      t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR# )é    N)Ú
namedtuple©ÚIS_WIN32)Úfind_libÚ	find_fileÚ_env_path_tupleÚbyÚinfoc                ó.   € V  F  w  rVf   K  W3u # 	  R# )z¯Find valid path from *options*, which is a list of 2-tuple of
(name, path).  Return first pair where *path* is not None.
If no valid path is found, return ('<unknown>', None)
)z	<unknown>N© )Úoptionsr	   Údatas   &  ÚK/opt/data/home/.local/lib/python3.14/site-packages/numba/cuda/cuda_paths.pyÚ_find_valid_pathr      s%   € ó
 ‰ˆØÔØ�8ŠOñ ð !Ð ó    c                  óœ   € R \        4       3R\        4       3R\        RR4      3R\        RR4      3R\	        4       3.p \        V 4      w  rW3# )úConda environmentú"Conda environment (NVIDIA package)Ú	CUDA_HOMEÚnvvmÚ	libdeviceÚSystemzDebian package)Úget_conda_ctkÚget_nvidia_libdevice_ctkÚget_cuda_homeÚget_system_ctkÚget_debian_pkg_libdevicer   ©r   r	   Úlibdirs      r   Ú_get_libdevice_path_decisionr       s_   € à	œm›oÐ.Ø	-Ô/GÓ/IÐJØ	”m F¨KÓ8Ð9Ø	”> &¨+Ó6Ð7Ø	Ô3Ó5Ð6ð€Gô " 'Ó*�J€BØˆ:Ðr   c                  ó"   € \         '       d   R# R# )r   )r   Úbin)r   Úlib64r   r   r   r   Ú_nvvm_lib_dirr$   %   s   € ßƒxØÐàÐr   c                  óš   € R \        4       3R\        4       3R\        \        4       !  3R\	        \        4       !  3.p \        V 4      w  rW3# ©r   r   r   r   )r   Úget_nvidia_nvvm_ctkr   r$   r   r   )r   r	   Úpaths      r   Ú_get_nvvm_path_decisionr)   ,   sR   € à	œm›oÐ.Ø	-Ô/BÓ/DÐEØ	”m¤]£_Ñ5Ð6Ø	”>¤=£?Ñ3Ð4ð	€Gô   Ó(�H€BØˆ8€Or   c                  óŽ   € \        4       w  rR p\        \        P                  ! V4      V4      p\	        VRR7      p\        W4      # )zlibdevice(\.\d+)*\.bc$N)Údefault)r    r   ÚreÚcompileÚmaxr   )r	   r   ÚpatÚ
candidatesÚouts        r   Ú_get_libdevice_pathsr2   7   s<   € Ü-Ó/�J€Bà
#€CÜœ2Ÿ:š: c›?¨FÓ3€Jä
ˆj $Ô
'€CÜ˜2Ó#Ð#r   c                  ó"   € \         '       d   R # R# )r"   r#   r   r   r   r   Ú_cudalib_pathr4   A   s   € ßƒxÙár   c                  ó"   € \         '       d   R# R# )Úlib)r6   Úx64)r#   r   r   r   r   Ú_cuda_home_static_cudalib_pathr8   H   s   € ßƒxØÐàÐr   c                  ó¢   € R \        4       3R\        4       3R\        \        4       4      3R\	        \        4       4      3.p \        V 4      w  rW3# r&   )r   Úget_nvidia_cudalib_ctkr   r4   r   r   r   s      r   Ú_get_cudalib_dir_path_decisionr;   O   sS   € à	œm›oÐ.Ø	-Ô/EÓ/GÐHØ	”m¤M£OÓ4Ð5Ø	”>¤-£/Ó2Ð3ð	€Gô " 'Ó*�J€BØˆ:Ðr   c                  óž   € R \        4       3R\        4       3R\        \        4       !  3R\	        \        4       4      3.p \        V 4      w  rW3# r&   )r   Úget_nvidia_static_cudalib_ctkr   r8   r   r4   r   r   s      r   Ú%_get_static_cudalib_dir_path_decisionr>   Z   sU   € à	œm›oÐ.Ø	-Ô/LÓ/NÐOØ	”mÔ%CÓ%EÑFÐGØ	”>¤-£/Ó2Ð3ð	€Gô " 'Ó*�J€BØˆ:Ðr   c                  ó0   € \        4       w  r\        W4      # ©N)r;   r   ©r	   r   s     r   Ú_get_cudalib_dirrB   e   s   € Ü/Ó1�J€BÜ˜2Ó&Ð&r   c                  ó0   € \        4       w  r\        W4      # r@   )r>   r   rA   s     r   Ú_get_static_cudalib_dirrD   j   s   € Ü6Ó8�J€BÜ˜2Ó&Ð&r   c                 óæ   € \         P                  P                  R4      '       dL   Rp\        P                  P                  V4      '       d#   \        P                  P                  ! V.V O5!  # R# R# )zJReturn path to system-wide cudatoolkit; or, None if it doesn't exist.
    Úlinuxz/usr/local/cudaN)ÚsysÚplatformÚ
startswithÚosr(   ÚexistsÚjoin)ÚsubdirsÚbases   * r   r   r   o   sU   € ô ‡|�|×Ñ˜w×'Ò'ð !ˆÜ�7‰7�>‰>˜$×ÒÜ—7‘7—<’< Ð/ wÓ/Ð/ñ  ñ	 (r   c                 ó&  € \         P                  P                  \         P                  P                  \        P
                  R4      4      p V '       g   R# \        R4      pV'       g   R# \         P                  P                  \        V4      4      # )úMReturn path to directory containing the shared libraries of cudatoolkit.
    ú
conda-metaNr   )	rJ   r(   rK   rL   rG   Úprefixr   Údirnamer.   )Úis_conda_envÚpathss     r   r   r   {   sV   € ô —7‘7—>‘>¤"§'¡'§,¡,¬s¯z©z¸<Ó"HÓI€LßÙä�VÓ€EßÙä�7‰7�?‰?œ3˜u›:Ó&Ð&r   c                 ó4  € \         P                  P                  \         P                  P                  \        P
                  R4      4      p V '       g   R# \         P                  P                  \        P
                  R\        4       4      p\         P                  P                  V4      '       d&   \         P                  P                  V4      '       g…   \         P                  P                  \        P
                  RR\        4       4      p\         P                  P                  V4      '       d&   \         P                  P                  V4      '       g   R# \        RVR7      pV'       g   R# \         P                  P                  \        V4      4      # )zAReturn path to directory containing the NVVM shared library.
    rQ   Nr   ÚLibrary)r   )rJ   r(   rK   rL   rG   rR   r4   Úisdirr   rS   r.   )rT   r   rU   s      r   r'   r'   ‰   sã   € ô —7‘7—>‘>¤"§'¡'§,¡,¬s¯z©z¸<Ó"HÓI€LßÙô �W‰W�\‰\œ#Ÿ*™* f¬m«oÓ>€FÜ�7‰7�>‰>˜&×!Ò!¬¯©¯©°v×)>Ò)>ä—‘—‘œcŸj™j¨)°V¼]»_ÓMˆÜ�w‰w�~‰~˜f×%Ò%¬R¯W©W¯]©]¸6×-BÒ-Bñ ä�V FÔ+€EßÙä�7‰7�?‰?œ3˜u›:Ó&Ð&r   c                 ó¨   € \        4       p V '       g   R# \        P                  P                  V 4      p\        P                  P	                  VR4      # )z?Return path to directory containing the libdevice library.
    Nr   )r'   rJ   r(   rS   rL   )Únvvm_ctkÚnvvm_dirs     r   r   r   ¤   s9   € ô #Ó$€HßÙÜ�w‰w�‰˜xÓ(€HÜ�7‰7�<‰<˜ +Ó.Ð.r   c                 ó   € \        4       p V '       g   R# \        P                  P                  \        P                  P                  V 4      4      p\        '       d   RMRp\        P                  P                  W4      # )rP   Nr"   r6   )r'   rJ   r(   rS   r   rL   )rZ   Úenv_dirÚsubdirs      r   r:   r:   ®   sO   € ô #Ó$€HßÙÜ�g‰g�o‰oœbŸg™gŸo™o¨hÓ7Ó8€Gß“h‰U E€FÜ�7‰7�<‰<˜Ó(Ð(r   c                 ó  € \        4       p V '       g   R# \        '       d   RV 9  d   RpMRp\        P                  P	                  \        P                  P	                  V 4      4      p\        P                  P
                  ! V.VO5!  # )zMReturn path to directory containing the static libraries of cudatoolkit.
    NrW   )ÚLibr7   )r6   )r'   r   rJ   r(   rS   rL   )rZ   Údirsr]   s      r   r=   r=   ¹   sa   € ô #Ó$€HßÙçƒx�Y hÔ.à‰ð ˆä�g‰g�o‰oœbŸg™gŸo™o¨hÓ7Ó8€GÜ�7‰7�<Š<˜Ð' $Ó'Ð'r   c                 óÖ   € \         P                  P                  R4      pVf    \         P                  P                  R4      pVe#   \         P                  P                  ! V.V O5!  # R# )zeGet paths of CUDA_HOME.
If *subdirs* are the subdirectory name to be appended in the resulting
path.
r   NÚ	CUDA_PATH)rJ   ÚenvironÚgetr(   rL   )rM   Ú	cuda_homes   * r   r   r   Ë   sQ   € ô
 —
‘
—‘˜{Ó+€IØÒä—J‘J—N‘N ;Ó/ˆ	ØÒÜ�w‰w�|Š|˜IÐ0¨Ó0Ð0ñ r   c                  ór   € \        4       w  r\        R V4      pV'       d   \        V4      MRp\        W4      # )r   N)r)   r   r.   r   )r	   r(   r0   s      r   Ú_get_nvvm_pathrh   Ø   s0   € Ü&Ó(�H€BÜ˜& $Ó'€Jß(Œ3ˆzŒ?¨d€DÜ˜2Ó$Ð$r   c            	     ó¼   € \        \        R4      '       d   \        P                  # R\        4       R\	        4       R\        4       R\        4       /p V \        n        V # )a$  Returns a dictionary mapping component names to a 2-tuple
of (source_variable, info).

The returned dictionary will have the following keys and infos:
- "nvvm": file_path
- "libdevice": List[Tuple[arch, file_path]]
- "cudalib_dir": directory_path

Note: The result of the function is cached.
Ú_cached_resultr   r   Úcudalib_dirÚstatic_cudalib_dir)ÚhasattrÚget_cuda_pathsrj   rh   r2   rB   rD   )Úds    r   rn   rn   ß   sY   € ô Œ~Ð/×0Ò0Ü×,Ñ,Ð,ð ”NÓ$ØÔ-Ó/ØÔ+Ó-Ø Ô"9Ó";ð	
ˆð )*ŒÔ%Øˆr   c                 óX   € Rp \         P                  P                  V 4      '       g   R# V # )zQ
Return the Debian NVIDIA Maintainers-packaged libdevice location, if it
exists.
z&/usr/lib/nvidia-cuda-toolkit/libdeviceN)rJ   r(   rK   )Úpkg_libdevice_locations    r   r   r   ú   s(   € ð
 FÐÜ�7‰7�>‰>Ð0×1Ò1ÙØ!Ð!r   ) rG   r,   rJ   Úcollectionsr   Únumba.core.configr   Únumba.misc.findlibr   r   r   r   r    r$   r)   r2   r4   r8   r;   r>   rB   rD   r   r   r'   r   r:   r=   r   rh   rn   r   r   r   r   Ú<module>ru      s“   ðÛ 
Û 	Û 	Ý "å &ß 2ñ Ð.°°v°Ó?€ò	!ò	òòò$òòòòò'ò
'ò
	0ò'ò'ò6/ò)ò(ò$
1ò%òô6"r   