
    Αi                        % S SK Jr  S SKJrJr  S SKJr  S SKJr  \(       a  S SK	J
r
  S SKJr  \\
\\4   rS\S'   S	/r S   SS jjrg
)    )annotations)TYPE_CHECKINGUnion)	TypeAlias)core)CustomPlace)_customDevicePropertiesr   _CustomPlaceLikeget_device_propertiesNc                   U Gb   [        U [        5      (       a/  U n[        R                  " 5       nU(       d  [	        S5      eUS   nO[        U [        R
                  5      (       a!  U R                  5       nU R                  5       nO[        U [        5      (       aX  U R                  S5      nUS:X  a  U nSnOyU SU nXS-   S nUR                  5       (       d  [	        SU S35      e[        U5      nO=[	        S	U  S
35      e[        R                  " 5       nU(       d  [	        S5      eUS   nSn[        R                  " X15      $ )ai  
Return the properties of given custom device.

Args:
    device (CustomPlace|str|int|None, optional): The device, the id of the device or
        the string name of device like 'metax_gpu:x' which to get the properties of the
        device from. Notice that this api only supports gpgpu backend. If device is None, the device is the current device.
        Default: None.

Returns:
    _customDeviceProperties: The properties of the device which include device name,
        major compute capability, minor compute capability, global memory available
        and the number of multiprocessors on the device.

Examples:
    .. code-block:: python

        >>> import paddle
        >>> paddle.device.get_device_properties('metax_gpu:0')
        >>> paddle.device.get_device_properties(0)
        >>> paddle.device.get_device_properties(paddle.CustomPlace('metax_gpu', 0))
Nz No custom device types availabler   :   zInvalid device ID 'z:'. After colon must be digits only. Example: 'metax_gpu:0'zThe device type z is not expected. Because paddle.device.get_device_properties only support int, str or CustomPlace. Please input appropriate device again!)
isinstanceintr   get_all_custom_device_type
ValueErrorr   get_device_typeget_device_idstrrfindisdigitr   )device	device_id	dev_typesdevice_name	colon_idxdevice_id_strs         [/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/paddle/device/gpgpu_backend.pyr   r   %   sL   2 fc""I779I !CDD#A,K 0 011 002K,,.I$$S)IB$	$Zi0 &1} 7$,,..$-m_ =1 1   .	"6( +9 9  335	?@@l	%%k==    )N)r   z_CustomPlaceLike | Nonereturnr	   )
__future__r   typingr   r   typing_extensionsr   paddle.baser   paddler   paddle.base.libpaddler	   r   r   r
   __annotations____all__r    r    r   <module>r+      se    # ' ' "="'	#i   '+C>#C>C>r    