a
    kh                     @   sF   d d dd dd dd ddd dd dd	Z d
d Zdd ZdS )c                 K   s   d| d  S )Ng  2C    widthkwargsr   r   C/var/www/auris/lib/python3.9/site-packages/triton/profiler/specs.py<lambda>       r   c                 K   s   d| d  S )Ng bBr   r   r   r   r   r   r      r   c                 K   s    |d | d d d | d  S )Nr   g    x:Ai  g   mBr   r   r   num_sms
clock_rater   r   r   r   r      s   c                 K   s   |d |d  d | d  S )Ni @       @@g    .Ar   r   r
   r   r   r   r      r   )80Z89Z90Z100c                 K   s   d| d  S )Ng  //bBr   r   r   r   r   r   r      r   c                 K   s   d| d  S )Ng ?y"Cr   r   r   r   r   r   r      r   )Zgfx90aZgfx942)ZCUDAZHIPc                 C   sJ   | t vrtd|  |t |  vr0td| t |  | }||||dS )a  
    Calculate the maximum FLOPS for a given device type and width.

    Args:
        device_type (str): The type of device (e.g., "CUDA", "HIP").
        arch (str): The architecture of the device (e.g., "80", "90").
        width (int): The width in bits.
        num_sms (int): The number of streaming multiprocessors.
        clock_rate (float): The clock rate in GHz.

    Returns:
        float: The maximum FLOPS for the given device type and width.
    zUnsupported device type: zUnsupported architecture: )r   r   )flops_by_device
ValueError)Zdevice_typearchr   r   r   Z
flops_funcr   r   r   	max_flops   s    r   c                 C   s   d|  | d d S )a  
    Calculate the maximum bytes per second for a given bus width and memory clock rate.

    Args:
        bus_width (int): The bus width in bits.
        memory_clock_rate (float): The memory clock rate in GHz.

    Returns:
        float: The maximum bytes per second.
       r   r   r   )Z	bus_widthZmemory_clock_rater   r   r   max_bps-   s    r   N)r   r   r   r   r   r   r   <module>   s   