a
    kŗh  ć                   @   s4   d Z ddlmZ ejdddZejd	ddZdS )
a­  
Grid Dependency Control (GDC) is a mechanism used when enabling programmatic dependent launch to launch and
synchronize grids. These APIs expose GDC to the programmer.

Programmatic dependent launch is supported on SM90 (Hopper) and beyond.
For PTX reference on grid dependency control see https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-griddepcontrol.
é    )ŚcoreNc              	   C   s   t jddg t jdd| d dS )aU  
    GDC wait is a blocking instruction that waits for all instructions in a prior kernel to complete before continuing.
    This ensures all memory operations happening before the wait is visible to instructions after it,
    e.g. if the prior kernel writes to address "x" the new values will be visible in this kernel after the wait.

    This instruction is also safe to execute when programatic dependent launch is disabled.

    See https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-griddepcontrol for more details.
    z griddepcontrol.wait; // dummy $0ś=rFé   ©ZdtypeŚis_pureŚpackŚ_builderN©r   Zinline_asm_elementwiseŚint32©r   © r   śL/var/www/auris/lib/python3.9/site-packages/triton/language/extra/cuda/gdc.pyŚgdc_wait   s    ’r   c              	   C   s   t jddg t jdd| d dS )a  
    This operation when launched with programmatic dependent launch signals that
    the next program may launch once all programs in the current kernel
    call this function or complete.

    Repeated calls to this function have no effect past the first call, and the first call should be
    treated by the programmer as a hint to the runtime system to launch the next kernel.

    This instruction is also safe to execute when programatic dependent launch is disabled.

    See https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-griddepcontrol for more details.
    z-griddepcontrol.launch_dependents; // dummy $0r   Fr   r   Nr	   r   r   r   r   Śgdc_launch_dependents   s    ’r   )N)N)Ś__doc__Ztriton.languager   Śexternr   r   r   r   r   r   Ś<module>   s
   