Ë
    üÇ:j<
  ã                   óÚ   — d Z ddlmZ ddlmZmZmZ ddlmZ ddl	m
Z
 ddlmZ dd	lmZmZmZ dd
„Zd„ Z G d„ de«      Zd„ Zd„ Zd„ Zd„ Zd„ Z G d„ de«      ZeZ	 	 	 dd„Zed„ «       Zy)z
Contains CUDA API functions
é    )Úcontextmanageré   )Úrequire_contextÚresetÚgpus©ÚFakeCUDAKernel)Úis_signature©Úwarné   )ÚInÚOutÚInOutc                 ó   — | dk(  sJ d«       ‚y )Nr   z/Only a single device supported by the simulator© )Údevs    úm/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/numba/cuda/simulator/api.pyÚselect_devicer      s   € Ø�!Š8ÐFÐFÓF‰8ó    c                   ó   — y©NTr   r   r   r   Úis_float16_supportedr      s   € Ør   c                   ó&   — e Zd ZdZed„ «       Zd„ Zy)Ústreamz“
    The stream API is supported in the simulator - however, all execution
    occurs synchronously, so synchronization requires no operation.
    c              #   ó   K  — d –— y ­w©Nr   ©Úselfs    r   Úauto_synchronizezstream.auto_synchronize   s	   è ø€ äùó   ‚c                  ó   — y r   r   r   s    r   Úsynchronizezstream.synchronize!   ó   € Ør   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r    r#   r   r   r   r   r      s    „ ñð ñó ðór   r   c                   ó   — y r   r   r   r   r   r#   r#   %   ó   € Ør   c                  ó   — dt         _        y r   )r   Úclosedr   r   r   Úcloser-   )   s	   € Ø„D…Kr   c                   ó   — y r   r   )ÚargsÚkwargss     r   Údeclare_devicer1   -   r*   r   c                  óR   — t        d«       t        ddz  «       t        ddz  «       y )NzFound 1 CUDA deviceszid %d    %20s %40s)r   Ú	SIMULATORz[SUPPORTED]z	%40s: 5.0zcompute capability)Úprintr   r   r   Údetectr5   1   s(   € Ü	Ð
 Ô!Ü	Ð
Ð!@Ñ
@ÔAÜ	ˆ+Ð,Ñ
,Õ-r   c                  ó   — t         S r   )r   r   r   r   Úlist_devicesr7   7   s   € Ü€Kr   c                   ó,   — e Zd ZdZdd„Zdd„Zd„ Zd„ Zy)ÚEventzš
    The simulator supports the event API, but they do not record timing info,
    and all simulation is synchronous. Execution time is not recorded.
    c                  ó   — y r   r   ©r   r   s     r   ÚrecordzEvent.recordB   r$   r   c                  ó   — y r   r   r;   s     r   Úwaitz
Event.waitE   r$   r   c                  ó   — y r   r   r   s    r   r#   zEvent.synchronizeH   r$   r   c                 ó   — t        d«       y)NzSimulator timings are bogusg        r   )r   Úevents     r   Úelapsed_timezEvent.elapsed_timeK   s   € ÜÐ*Ô+Ør   N©r   )r%   r&   r'   r(   r<   r>   r#   rB   r   r   r   r9   r9   =   s   „ ñóóòór   r9   Nc                 ó¤   ‡‡‡— |rt        d«      ‚|�t        d«      ‚| �t        | «      st        | t        «      r	ˆˆˆfd„}|S t	        | ‰‰¬«      S )Nz)bounds checking is not supported for CUDAz Cannot link PTX in the simulatorc                 ó"   •— t        | ‰‰‰¬«      S )N)ÚdeviceÚfastmathÚdebugr   )ÚfnrH   rF   rG   s    €€€r   Ú
jitwrapperzjit.<locals>.jitwrapperb   s   ø€ Ü! "Ø)/Ø+3Ø(-ô/ð /r   )rF   rH   )ÚNotImplementedErrorr
   Ú
isinstanceÚlistr	   )Úfunc_or_sigrF   rH   ÚargtypesÚinlineÚrestyperG   ÚlinkÚboundscheckÚoptÚcacherJ   s    ``   `     r   ÚjitrV   S   s[   ú€ ñ
 Ü!Ð"MÓNÐNàÐÜ!Ð"DÓEÐEð 	Ðœ|¨KÔ8Ü˜+¤tÔ,ö	/ð
 ÐÜ˜+¨f¸EÔBÐBr   c               #   ó   K  — d –— y ­wr   r   r   r   r   Údefer_cleanuprX   k   s   è ø€ ô 
ùr!   rC   )NFFNFNFNNTN)r(   Ú
contextlibr   Úcudadrv.devicesr   r   r   Úkernelr	   Únumba.core.sigutilsr
   Úwarningsr   r/   r   r   r   r   r   Úobjectr   r#   r-   r1   r5   r7   r9   rA   rV   rX   r   r   r   ú<module>r_      s�   ðñõ &ç 9Ñ 9Ý "Ý ,Ý ß !Ñ !óGòô
ˆVô 
ò	òò	ò.òôˆFô ð& 	€ð ?CØ9=Ø*.óCð0 ñ
ó ñ
r   