o
    1ÎjÜ  ã                   @   sD   d dl mZmZ d dlmZ d dlmZ dd„ Zdd„ Zdd	„ Z	d
S )é   )Úget_default_deviceÚparse_device)Úget_device_type)Úimport_paddle_modulec                  C   s   t dƒj} t| dƒS )Nzpaddle.inferenceZset_mkldnn_cache_capacity)r   ÚConfigÚhasattr)r   © r   ú]/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/paddlex/inference/utils/misc.pyÚis_mkldnn_available   s   

r
   c                 C   s<   t dƒ}| d u rtƒ } t| ƒ\}}dtƒ v s| ¡ o|dv S )Nú
paddle.ampÚnpu)Úgpur   ÚxpuÚmluÚ	metax_gpuÚiluvatar_gpu)r   r   r   r   Zis_bfloat16_supported©ZdeviceZ
paddle_ampZdevice_typeÚ_r   r   r	   Úis_bfloat16_available   s   ÿr   c                 C   s8   t dƒ}| d u rtƒ } t| ƒ\}}dtƒ v s| ¡ odS )Nr   r   )r   r   r   r   Zdcur   r   )r   r   r   r   Zis_float16_supportedr   r   r   r	   Úis_float16_available&   s
   r   N)
Zutils.devicer   r   Z	utils.envr   Zutils.import_guardr   r
   r   r   r   r   r   r	   Ú<module>   s   