o
    ^i                     @   s   U d dl mZmZ d dlmZ G dd deZG dd deZG dd dZed	e d
Zee e	d	< defddZ
ed	e d
aee	d< dee fddZdS )    )OptionalProtocol)
ContextVarc                   @   s   e Zd ZdefddZdS )Bufferreturnc                 C      d S N )selfr	   r	   U/var/www/html/RAG/RAG_venv/lib/python3.10/site-packages/triton/runtime/_allocation.pydata_ptr      zBuffer.data_ptrN)__name__
__module____qualname__intr   r	   r	   r	   r   r      s    r   c                   @   *   e Zd Zdededee defddZdS )	Allocatorsize	alignmentstreamr   c                 C   r   r   r	   r
   r   r   r   r	   r	   r   __call__   r   zAllocator.__call__Nr   r   r   r   r   r   r   r	   r	   r	   r   r          "r   c                   @   r   )NullAllocatorr   r   r   r   c                 C   s   t d)NzxKernel requires a runtime memory allocation, but no allocator was set. Use triton.set_allocator to specify an allocator.)RuntimeErrorr   r	   r	   r   r      s   zNullAllocator.__call__Nr   r	   r	   r	   r   r      r   r   
_allocator)default	allocatorc                 C      t |  dS )z
    The allocator function is called during kernel launch for kernels that
    require additional global memory workspace.
    N)r   setr   r	   r	   r   set_allocator   s   r#   _profile_allocatorc                 C   r    )z
    The profile allocator function is called before kernel launch for kernels
    that require additional global memory workspace.
    N)r$   r!   r"   r	   r	   r   set_profile_allocator&   s   r%   N)typingr   r   contextvarsr   r   r   r   r   __annotations__r#   r$   r%   r	   r	   r	   r   <module>   s    