U
    ©Ê¹jì
  ã                   @   sð   d Z ddlmZ ddlmZmZmZ ddlZddlm	Z
 ddlmZ d	d
dddddgZee
eedf Zedœdd„Zedœdd	„Zdeddœdd
„ZG dd„ dƒZeƒ Zeadeedœdd„ZG dd„ deƒZeedœdd„Zedœdd„ZdS )zj
This package implements abstractions found in ``torch.cuda``
to facilitate writing device-agnostic code.
é    )ÚAbstractContextManager)ÚAnyÚOptionalÚUnionNé   ©Údeviceé   )ÚampÚis_availableÚsynchronizeÚcurrent_streamÚstreamÚdevice_countÚStreamÚStreamContext)Úreturnc                   C   s   t jj ¡ S )z/Returns a bool indicating if CPU supports VNNI.)ÚtorchZ_CZ_cpuÚ_is_cpu_support_vnni© r   r   úQ/var/www/html/bwave/python/venv/lib/python3.8/site-packages/torch/cpu/__init__.pyr      s    r   c                   C   s   dS )z…Returns a bool indicating if CPU is currently available.

    N.B. This function only exists to facilitate device-agnostic code

    Tr   r   r   r   r   r      s    )r   r   c                 C   s   dS )zñWaits for all kernels in all streams on the CPU device to complete.

    Args:
        device (torch.device or int, optional): ignored, there's only one CPU device.

    N.B. This function only exists to facilitate device-agnostic code.
    Nr   r   r   r   r   r   (   s    c                   @   s   e Zd ZdZdS )r   zH
    N.B. This class only exists to facilitate device-agnostic code
    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   3   s   c                 C   s   t S )zÓReturns the currently selected :class:`Stream` for a given device.

    Args:
        device (torch.device or int, optional): Ignored.

    N.B. This function only exists to facilitate device-agnostic code

    )Ú_current_streamr   r   r   r   r   ?   s    	c                   @   s@   e Zd ZU dZee ed< dd„ Zdd„ Ze	e	e	dœdd	„Z
d
S )r   zvContext-manager that selects a given stream.

    N.B. This class only exists to facilitate device-agnostic code

    Ú
cur_streamc                 C   s   || _ t| _d S ©N)r   Ú_default_cpu_streamÚprev_stream)Úselfr   r   r   r   Ú__init__S   s    zStreamContext.__init__c                 C   s    | j }|d krd S t| _|ad S r   )r   r   r   )r    r   r   r   r   Ú	__enter__W   s
    zStreamContext.__enter__)ÚtypeÚvalueÚ	tracebackc                 C   s   | j }|d krd S | jad S r   )r   r   r   )r    r#   r$   r%   r   r   r   r   Ú__exit__`   s    zStreamContext.__exit__N)r   r   r   r   r   r   Ú__annotations__r!   r"   r   r&   r   r   r   r   r   K   s
   
	)r   r   c                 C   s   t | ƒS )z�Wrapper around the Context-manager StreamContext that
    selects a given stream.

    N.B. This function only exists to facilitate device-agnostic code
    )r   )r   r   r   r   r   i   s    c                   C   s   dS )z€Returns number of CPU devices (not cores). Always 1.

    N.B. This function only exists to facilitate device-agnostic code
    r	   r   r   r   r   r   r   r   s    )N)N)r   Ú
contextlibr   Útypingr   r   r   r   Ú r   Z_devicer
   Ú__all__ÚstrÚintZ	_device_tÚboolr   r   r   r   r   r   r   r   r   r   r   r   r   r   Ú<module>   s0   ù
		