o
    پi	                     @   sf   d Z ddlZddlmZ eejd Zdd Zdd Zd	d
 Z	dd Z
dd Ze
 Ze Zg dZdS )a3  
Copyright (c) 2025 by FlashInfer team.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
    N)Pathcubinsc                   C   s   t tS )z(Get the directory containing the cubins.str	CUBIN_DIR r   r   M/home/ubuntu/.local/lib/python3.10/site-packages/flashinfer_cubin/__init__.pyget_cubin_dir   s   r	   c                  C   sd   t  sg S g } tt D ] \}}}|D ]}|dr,tjtj||t }| | qqt	| S )zList all available cubin files.z.cubin)
r   existsoswalkendswithpathrelpathjoinappendsorted)r   root_filesfilerel_pathr   r   r   list_cubins   s   

r   c                 C   s   t t|  S )z/Get the absolute path to a specific cubin file.r   )relative_pathr   r   r   get_cubin_path+   s   r   c                  C   s|   z
ddl m}  | jW S  ty   Y nw ttjjjd }| r<t|d}|	 
 W  d    S 1 s7w   Y  dS )N   _build_metazversion.txtrz0.0.0) r   __version__ImportErrorr   __file__parentr
   openreadstrip)r   version_filefr   r   r   _get_version1   s   
 r)   c               	   C   s.   z
ddl m}  | jW S  ttfy   Y dS w )Nr   r   unknown)r   r   __git_version__r!   AttributeErrorr   r   r   r   _get_git_versionB   s   r-   )r	   r   r   r   )__doc__r   pathlibr   r"   r#   r   r	   r   r   r)   r-   r    r+   __all__r   r   r   r   <module>   s    