o
    ³´„i;  ã                   @   sX   d dl mZmZmZmZ ddlmZmZ g d¢Zeddd„ƒZ	ed	ddd
œdd„ƒZ
dS )é   )ÚMBarrierLayoutÚinitÚ
invalidateÚwaité   )Ú_unwrap_if_constexprÚbuiltin)ÚarriveÚexpectr   r   r   r   TNc                 C   ó*   t |ƒ}| |¡}|j | j||j¡ dS )am  
    Expect a specific number of bytes being copied. When they are copied, the barrier is signaled.

    Args:
        mbarrier (shared_memory_descriptor): Barrier that will be signaled when the operation is complete.
        bytes (int): Expected byte count.
        pred (bool): Scalar predicate. Operation is skipped if predicate is False. Defaults to True.
    N)r   Ú	to_tensorÚbuilderÚcreate_mbarrier_expectÚhandle)ÚmbarrierÚbytesÚpredÚ	_semantic© r   úl/home/kuhnn/.local/lib/python3.10/site-packages/triton/experimental/gluon/language/nvidia/hopper/mbarrier.pyr
      ó   

r
   é   )Úcountr   r   c                C   r   )a'  
    Arrive at an mbarrier with a specified count.

    Args:
        mbarrier (shared_memory_descriptor): Barrier to be signalled.
        count (int): Count to arrive with. Defaults to 1.
        pred (bool): Scalar predicate. Operation is skipped if predicate is False. Defaults to True.
    N)r   r   r   Úcreate_mbarrier_arriver   )r   r   r   r   r   r   r   r	      r   r	   )TN)Úampere.mbarrierr   r   r   r   Ú_corer   r   Ú__all__r
   r	   r   r   r   r   Ú<module>   s    