�
.��g� � �T � d dl mZmZmZ G d� de�� � Z G d� de� � ZdS )� )�ABCMeta�abstractmethod�abstractclassmethodc �B � e Zd Zed� � � Zed� � � Zdd�ZdS )�
DriverBasec � � d S �N� ��selfs �f/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/triton/backends/driver.py� is_activezDriverBase.is_active � � ��� c � � d S r r
r s r
�get_current_targetzDriverBase.get_current_target
r r �returnNc � � d S r r
r s r
�__init__zDriverBase.__init__ s � ��r )r N)�__name__�
__module__�__qualname__r r r r r r
r r
r r s] � � � � � ��
�
� ��
� �
�
� �^�
�
�
�
�
�
�
r r )� metaclassc � � e Zd Zd� Zd� ZdS )� GPUDriverc �� �� dd l ��j j | _ ddlm} || _ n# t $ r
�fd�| _ Y nw xY w�j j | _ �j j | _
d S )Nr )�_cuda_getCurrentRawStreamc �B �� �j � | � � j S r )�cuda�current_stream�cuda_stream)�idx�torchs �r
�<lambda>z$GPUDriver.__init__.<locals>.<lambda> s �� �%�*�2K�2K�C�2P�2P�2\� r )r# r �get_device_capability�torch._Cr �get_current_stream�ImportError�current_device�get_current_device�
set_device�set_current_device)r r r# s @r
r zGPUDriver.__init__ s� �� �����%*�Z�%E��"� ]�:�:�:�:�:�:�&?�D�#�#��� ]� ]� ]�&\�&\�&\�&\�D�#�#�#� ]����"'�*�";���"'�*�"7����s �
&