§
    L�’j‹  ã                   óä   — d dl mZ d dlmZmZ d dlZd dlmZ	 g d¢Z
defd„Zedefd„¦   «         Zed	ed
edefd„¦   «         Zedd
edefd„¦   «         Zedefd„¦   «         Zedefd„¦   «         ZdS )é    )Ú	lru_cache)ÚOptionalÚTYPE_CHECKINGN)ÚLibrary)Úget_core_countÚget_nameÚis_builtÚis_availableÚis_macos13_or_newerÚis_macos_or_newerÚreturnc                  ó$   — t           j        j        S )zóReturn whether PyTorch is built with MPS support.

    Note that this doesn't necessarily mean MPS is available; just that
    if this PyTorch binary were run a machine with working MPS drivers
    and devices, we would be able to use it.
    )ÚtorchÚ_CÚ_has_mps© ó    úIC:\Projects\DSCons\.venv\Lib\site-packages\torch\backends\mps\__init__.pyr	   r	      s   € õ Œ8ÔÐr   c                  ó>   — t           j                             ¦   «         S )z7Return a bool indicating if MPS is currently available.)r   r   Ú_mps_is_availabler   r   r   r
   r
      s   € õ Œ8×%Ò%Ñ'Ô'Ð'r   ÚmajorÚminorc                 óB   — t           j                             | |¦  «        S )zHReturn a bool indicating whether MPS is running on given MacOS or newer.©r   r   Ú_mps_is_on_macos_or_newer)r   r   s     r   r   r   "   s   € õ Œ8×-Ò-¨e°UÑ;Ô;Ð;r   c                 óB   — t           j                             d| ¦  «        S )zEReturn a bool indicating whether MPS is running on MacOS 13 or newer.é   r   )r   s    r   r   r   (   s   € õ Œ8×-Ò-¨b°%Ñ8Ô8Ð8r   c                  ó>   — t           j                             ¦   «         S )zReturn Metal device name)r   r   Ú_mps_get_namer   r   r   r   r   .   s   € õ Œ8×!Ò!Ñ#Ô#Ð#r   c                  ó>   — t           j                             ¦   «         S )zõReturn GPU core count.

    According to the documentation, one core is comprised of 16 Execution Units.
    One execution Unit has 8 ALUs.
    And one ALU can run 24 threads, i.e. one core is capable of executing 3072 threads concurrently.
    )r   r   Ú_mps_get_core_countr   r   r   r   r   4   s   € õ Œ8×'Ò'Ñ)Ô)Ð)r   )r   )Ú	functoolsr   Ú
_lru_cacheÚtypingr   r   r   Útorch.libraryr   Ú_LibraryÚ__all__Úboolr	   r
   Úintr   r   Ústrr   r   r   r   r   ú<module>r+      s]  ðØ -Ð -Ð -Ð -Ð -Ð -Ø *Ð *Ð *Ð *Ð *Ð *Ð *Ð *à €€€Ø -Ð -Ð -Ð -Ð -Ð -ðð ð €ð�$ð ð ð ð ð ð(�dð (ð (ð (ñ „ð(ð
 ð<˜Sð <¨ð <°ð <ð <ð <ñ „ð<ð
 ð9ð 9˜sð 9¨4ð 9ð 9ð 9ñ „ð9ð
 ð$�#ð $ð $ð $ñ „ð$ð
 ð*˜ð *ð *ð *ñ „ð*ð *ð *r   