
    gg[                     h   S SK r S SKJrJrJr  \" SS\R
                  S 5      \" SS\R
                  S 5      \" SS\R
                  S S5      \" SS\R
                  S 5      \" SS\R
                  S 5      \" S	S\R
                  S 5      \" S
S\R
                  S 5      /rS rS rS r	S r
S rS rS rg)    N)MetricRequestRequestedMetricsParser
Importancez)smsp__sass_inst_executed_op_shared_ld.sumz)smsp__sass_inst_executed_op_shared_st.sumsmsp__inst_executed_op_ldsm.sumFz4l1tex__data_pipe_lsu_wavefronts_mem_shared_op_ld.sumz4l1tex__data_pipe_lsu_wavefronts_mem_shared_op_st.sumz8l1tex__data_bank_conflicts_pipe_lsu_mem_shared_op_ld.sumz8l1tex__data_bank_conflicts_pipe_lsu_mem_shared_op_st.sumc                      g)NSharedMemoryConflicts r	       9nsight-compute-2025.1.1/sections/SharedMemoryConflicts.pyget_identifierr   '   s    "r
   c                      g)NzShared Memory Conflictsr	   r	   r
   r   get_namer   *   s    $r
   c                      g)Nz*Detection of shared memory bank conflicts.r	   r	   r
   r   get_descriptionr   -   s    7r
   c                      g)NMemoryWorkloadAnalysis_Tablesr	   r	   r
   r   get_section_identifierr   0   s    *r
   c                      S/$ )NMemoryr	   r	   r
   r   get_parent_rules_identifiersr   3   s
    :r
   c                     SnX ;   a(  [         R                  R                  nX   S-  nX-  nX54$ [         R                  R                  nUnX54$ )N2l1tex__throughput.avg.pct_of_peak_sustained_actived   )NvRules	IFrontendSpeedupType_GLOBALSpeedupType_LOCAL)parent_weightsbank_conflicts_percentl1tex_throughput_namespeedup_typel1tex_throughputimprovement_percents         r   get_estimated_speedupr$   7   sc    P.((;;)@3F4G
 ,, ((::4,,r
   c                    [         R                  " U 5      nUR                  S5      R                  S5      nUR	                  5       n[        X5      R                  [        5      nUR                  S5      nSS/SS/S.nUR                  5        GH4  u  pxUSUS	    S
3   R                  5       n	US:X  a  XS   R                  5       -  n	U	S:X  a  MC  USUS    S
3   R                  5       n
SUS    S
3nXK   R                  5       nU
S:  a  US-  U
-  OSnSnX:  d  M  SR                  UR                  5       5      nUSR                  X-  5      -  nUSR                  XR                  5       5      -  nUSR                  U5      -  nUSR                  U5      -  nUSR                  XR                  5       5      -  nUSR                  UR                  5       5      -  nUR                  [         R                  R                  USR                  U5      5      n[!        X]5      u  nnUR#                  UUU5        UR%                  UUU[         R                  R&                  SR                  UR                  5       5      5        SnUU;   d  GM  UR%                  UUUU   [         R                  R(                  S5        GM7     g )Nr   r   mem_shared_op_ld	shared_ldmem_shared_op_st	shared_st)Shared LoadzShared Storesmsp__sass_inst_executed_op_   z.sumr*   r    l1tex__data_pipe_lsu_wavefronts_$l1tex__data_bank_conflicts_pipe_lsu_g      Y@g        g      $@z7The memory access pattern for {}s might not be optimal z3and causes on average a {:.1f} - way bank conflict zacross all {:.0f} {} requests.z'This results in {:.0f} bank conflicts, z which represent {:.2f}% z)of the overall {:.0f} wavefronts for {}s.zP Check the @section:SourceCounters:Source Counters@ section for uncoalesced {}s.z{} Bank ConflictszDecrease bank conflicts for {}sr   zHThe higher the L1/TEX cache throughput the more severe the issue becomes)r   get_contextrange_by_idxaction_by_idxfrontendr   parserequested_metricsreceive_dict_from_parentitemsvalueformatlowermessager   MsgType_MSG_OPTIMIZATIONr$   speedupfocus_metricSeverity_SEVERITY_HIGHSeverity_SEVERITY_LOW)handlectxactionfemetricsr   shared_access_typesaccess_info
metric_strrequests
wavefrontsbank_conflicts_metric_namebank_conflictsr   bank_conflicts_thresholdr:   msg_idr!   speedup_valuer    s                       r   applyrO   E   s   


f
%Ca ..q1F	B$V4::;LMG00:N -k:,k:
 $7#<#<#>9*Q-MNTTV-' ABHHJJHq=?
1dSTZZ\
'KJWXM?Z^%_" <BBDJTWX..5"8J!F^a#' ">OVVWbWhWhWjkGLSST^TijjG7>>xIZIZI\]]G@GGWWG299:PQQGBII*VgVgVijjGippq|  rC  rC  rE  F  FGZZ 1 1 J JGUhUoUop{U|}F*?*g'L-JJv|];OO*!!881889J9J9LM %Y!$6)"#89%%;;^Q $?r
   )r   RequestedMetricsr   r   r   OPTIONALr4   r   r   r   r   r   r$   rO   r	   r
   r   <module>rR      s   2  N N =tZEXEXZ[\=tZEXEXZ[\3T:;N;NPQSXYH$PZPcPcefgH$PZPcPcefgLdT^TgTgijkLdT^TgTgijk #%8+-:r
   