o
    	i
                     @   s   d dl mZ d dlmZ d dlm  mZ ddlm	Z	m
Z
 d dlmZ ddlmZ ed	Zd
ee de	e fddZeejZeejZeejZeejZeejZeejZe
dddZe
dddZe
dddZdS )    )TypeVar)JITFunctionN   )GluonJITFunctionjit)knobs   )_coreTfnreturnc                 C   s,   t jjst| tsJ t| j}| j|_|S N)r   runtime	interpret
isinstancer   r   r   __doc__)r   gluon_fn r   b/home/ubuntu/vllm_env/lib/python3.10/site-packages/triton/experimental/gluon/language/_standard.py_import_from_triton   s   
r   c                 C   s   t | d||S )aV  
    Create a tensor filled with zeros.

    Args:
        shape (Sequence[int]): The shape of the tensor.
        dtype (dtype): The data type for the tensor.
        layout (Optional[DistributedLayout]): The distributed layout of the tensor, defaults to AutoLayout().

    Returns:
        tensor: A tensor where every element is zero.
    r   )ttglfullshapedtypelayoutr   r   r   zeros   s   r   c                 C   s>   t |du r	| jn|||du r| jn||du r| jjS |S )a-  
    Create a tensor with the same properties as a given tensor, filled with a specified value.

    Args:
        input (tensor): Reference tensor to infer default shape, dtype, and layout.
        value (int or float): The fill value.
        shape (Sequence[int], optional): Target shape. Defaults to input.shape.
        dtype (dtype, optional): Target data type. Defaults to input.dtype.
        layout (DistributedLayout, optional): Target layout. Defaults to input.layout.

    Returns:
        tensor: A tensor where every element equals value.
    N)r   r   r   r   typer   )inputvaluer   r   r   r   r   r   	full_like+   s   r    c                 C   s   t | d|||dS )a  
    Create a tensor with the same properties as a given tensor, filled with zeros.

    Args:
        input (tensor): Reference tensor to infer default shape, dtype, and layout.
        shape (Sequence[int], optional): Target shape. Defaults to input.shape.
        dtype (dtype, optional): Target data type. Defaults to input.dtype.
        layout (DistributedLayout, optional): Target layout. Defaults to input.layout.

    Returns:
        tensor: A tensor where every element is zero.
    r   r   )r    )r   r   r   r   r   r   r   
zeros_likeB   s   r!   r   )NNN)typingr   triton.runtime.jitr   triton.language.standardlanguagestandardtl_standard_runtimer   r   tritonr    r	   r   r
   r   cdivsummaxmin	reduce_orxor_sumr   r    r!   r   r   r   r   <module>   s(    





