
    ȅiS                         % S SK Jr  S SKJrJr  S SKrS SKJr	  / SQr
S\4S jr\S\4S j5       r\S	\S
\S\4S j5       r\SS
\S\4S jj5       r\S\4S j5       r\S\4S j5       rSq\\	   \S'   SS jrg)    )	lru_cache)OptionalTYPE_CHECKINGN)Library)get_core_countget_nameis_builtis_availableis_macos13_or_neweris_macos_or_newerreturnc                  6    [         R                  R                  $ )zReturn 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     U/home/james-whalen/.local/lib/python3.13/site-packages/torch/backends/mps/__init__.pyr	   r	      s     88r   c                  >    [         R                  R                  5       $ )z7Return a bool indicating if MPS is currently available.)r   r   _mps_is_availabler   r   r   r
   r
      s     88%%''r   majorminorc                 @    [         R                  R                  X5      $ )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     88--e;;r   c                 B    [         R                  R                  SU 5      $ )zEReturn a bool indicating whether MPS is running on MacOS 13 or newer.   r   )r   s    r   r   r   (   s     88--b%88r   c                  >    [         R                  R                  5       $ )zReturn Metal device name)r   r   _mps_get_namer   r   r   r   r   .   s     88!!##r   c                  >    [         R                  R                  5       $ )zReturn 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     88''))r   _libc                      [         c  [        5       (       d  gSSKJn   SSKJn  [        SS5      q [         R                  SUS5        [         R                  S	U S5        g)
z<Register prims as implementation of var_mean and group_norm.Nr   )native_group_norm_backward)native_group_normatenIMPLr%   MPSr$   )r"   r	   torch._decomp.decompositionsr$   torch._refsr%   _Libraryimpl)r$   r%   s     r   _initr-   B   sI     xzzG-FF#DII!#4e<II*,FNr   )r   )r   N)	functoolsr   
_lru_cachetypingr   r   r   torch.libraryr   r+   __all__boolr	   r
   intr   r   strr   r   r"   __annotations__r-   r   r   r   <module>r7      s    - *  -$  (d ( (
 <S < < < <
 9s 94 9 9
 $# $ $
 * * *  hx Or   