
    rh                     6    d  d d d dd d ddZ d	 Zd
 Zy)c                     d| dz  z  S )Ng  2C    widthkwargss     h/var/www/html/ai-insurance-compliance-backend/venv/lib/python3.12/site-packages/triton/profiler/specs.py<lambda>r	      s    %!) 4     c                     d| dz  z  S )Ng bBr   r   r   s     r   r	   r	      s    %!) < r
   c                 0    |dz  |z  dz  dz  dz  | dz  z  S )Nr   g    x:Ai  g   mBr   r   r   num_sms
clock_rater   s       r   r	   r	      s-    w}z7QU_7`cg7gko6o	6 r
   c                 *    |dz  |dz  z  dz  | dz  z  S )Ni @       @@g    .Ar   r   r   s       r   r	   r	      s'    goVYIY6Z]`6`ejmnen5o r
   )808990100c                     d| dz  z  S )Ng  //bBr   r   r   s     r   r	   r	      s    &EAI*> r
   c                     d| dz  z  S )Ng ?y"Cr   r   r   s     r   r	   r	      s    )uqy*A r
   )gfx90agfx942)CUDAHIPc                     | t         vrt        d|        |t         |    vrt        d|       t         |    |   } ||||      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)device_typearchr   r   r   
flops_funcs         r   	max_flopsr#      s]     /)4[MBCC?;//5dV<== -d3JeWDDr
   c                     d| z  |z  dz  dz  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   )	bus_widthmemory_clock_rates     r   max_bpsr(   -   s     y=,,s2Q66r
   N)r   r#   r(   r   r
   r   <module>r)      s<    	5<	 	p
 ?A&E27r
   