Ë
      çi½  ã                   ól   — d dl mZ d dlZd dlmZ d dlmZ d dlmZ  G d„ de«      Z	dee
ef   d	e
fd
„Zy)é    )ÚUnionN)Úoverride)ÚAccelerator)Ú_AcceleratorRegistryc                   óJ  — e Zd ZdZedej                  ddfd„«       Zedd„«       Ze	ede
eef   defd„«       «       Ze	ede
eef   deej                     fd	„«       «       Ze	edefd
„«       «       Ze	edefd„«       «       Ze	edefd„«       «       Zeededdfd„«       «       Zy)ÚCPUAcceleratorzAccelerator for CPU devices.ÚdeviceÚreturnNc                 ó@   — |j                   dk7  rt        d|› d�«      ‚y)zd
        Raises:
            ValueError:
                If the selected device is not CPU.
        ÚcpuzDevice should be CPU, got z	 instead.N)ÚtypeÚ
ValueError)Úselfr	   s     úv/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/lightning_fabric/accelerators/cpu.pyÚsetup_devicezCPUAccelerator.setup_device   s*   € ð �;‰;˜%ÒÜÐ9¸&¸ÀÐKÓLÐLð  ó    c                  ó   — y )N© )r   s    r   ÚteardownzCPUAccelerator.teardown$   s   € àr   Údevicesc                 ó   — t        | «      S )z!Accelerator device parsing logic.)Ú_parse_cpu_cores©r   s    r   Úparse_deviceszCPUAccelerator.parse_devices(   s   € ô   Ó(Ð(r   c                 óJ   — t        | «      } t        j                  d«      g| z  S )z*Gets parallel devices for the Accelerator.r   )r   Útorchr	   r   s    r   Úget_parallel_devicesz#CPUAccelerator.get_parallel_devices.   s%   € ô # 7Ó+ˆÜ—‘˜UÓ#Ð$ wÑ.Ð.r   c                   ó   — y)z!Get the devices when set to auto.é   r   r   r   r   Úauto_device_countz CPUAccelerator.auto_device_count5   s   € ð r   c                   ó   — y)z&CPU is always available for execution.Tr   r   r   r   Úis_availablezCPUAccelerator.is_available;   s   € ð r   c                   ó   — y)Nr   r   r   r   r   ÚnamezCPUAccelerator.nameA   s   € ð r   Úaccelerator_registryc                 ó\   — |j                  | j                  «       | | j                  ¬«       y )N)Údescription)Úregisterr$   Ú__name__)Úclsr%   s     r   Úregister_acceleratorsz$CPUAccelerator.register_acceleratorsF   s*   € ð 	×%Ñ%Ø�H‰H‹JØØŸ™ð 	&õ 	
r   )r
   N)r)   Ú
__module__Ú__qualname__Ú__doc__r   r   r	   r   r   Ústaticmethodr   ÚintÚstrr   Úlistr   r    Úboolr"   r$   Úclassmethodr   r+   r   r   r   r   r      sC  „ Ù&àðM 5§<¡<ð M°Dò Mó ðMð òó ðð Øð)˜u S¨# X™ð )°3ò )ó ó ð)ð Øð/ e¨C°¨H¡oð /¸$¸u¿|¹|Ñ:Lò /ó ó ð/ð
 Øð˜sò ó ó ðð Øð˜$ò ó ó ðð Øð�#ò ó ó ðð Øð
Ð9Mð 
ÐRVò 
ó ó ñ
r   r   Ú	cpu_coresr
   c                 ó¸   — t        | t        «      r)| j                  «       j                  «       rt	        | «      } t        | t        «      r| dk  rt        d«      ‚| S )a�  Parses the cpu_cores given in the format as accepted by the ``devices`` argument in the
    :class:`~pytorch_lightning.trainer.trainer.Trainer`.

    Args:
        cpu_cores: An int > 0 or a string that can be converted to an int > 0.

    Returns:
        An int representing the number of processes

    Raises:
        MisconfigurationException:
            If cpu_cores is not an int > 0

    r   z>`devices` selected with `CPUAccelerator` should be an int > 0.)Ú
isinstancer1   ÚstripÚisdigitr0   Ú	TypeError)r5   s    r   r   r   P   sK   € ô �)œSÔ! i§o¡oÓ&7×&?Ñ&?Ô&AÜ˜	“Nˆ	ä�i¤Ô%¨°aªÜÐXÓYÐYàÐr   )Útypingr   r   Útyping_extensionsr   Ú)lightning_fabric.accelerators.acceleratorr   Ú&lightning_fabric.accelerators.registryr   r   r0   r1   r   r   r   r   Ú<module>r?      s>   ðõ ã Ý &å AÝ Gô6
�[ô 6
ðr  c¨3 h¡ð °Cô r   