
    h                     6    S  S S S S.S S S.S.r S	 rS
 rg)c                     SU S-  -  $ )Ng  2C    widthkwargss     O/var/www/fran/franai/venv/lib/python3.13/site-packages/triton/profiler/specs.py<lambda>r	      s    %!) 4    c                     SU S-  -  $ )Ng bBr   r   r   s     r   r	   r	      s    %!) <r
   c                 0    US-  U-  S-  S-  S-  U 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                 *    US-  US-  -  S-  U S-  -  $ )Ni @       @@g    .Ar   r   r   s       r   r	   r	      s%    goVYIY6Z]`6`ejmnen5or
   )808990100c                     SU S-  -  $ )Ng  //bBr   r   r   s     r   r	   r	      s    &EAI*>r
   c                     SU S-  -  $ )Ng ?y"Cr   r   r   s     r   r	   r	      s    )uqy*Ar
   )gfx90agfx942)CUDAHIPc                     U [         ;  a  [        SU  35      eU[         U    ;  a  [        SU 35      e[         U    U   nU" X#US9$ )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eDDr
   c                     SU -  U-  S-  S-  $ )z
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
   