
    J/Ph<
                         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dS )z
Contains CUDA API functions
    )contextmanager   )require_contextresetgpusFakeCUDAKernel)is_signaturewarn   )InOutInOutc                 &    | dk    s
J d            d S )Nr   z/Only a single device supported by the simulator )devs    X/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numba/cuda/simulator/api.pyselect_devicer      s    !888F88888    c                      dS NTr   r   r   r   is_float16_supportedr      s    4r   c                   .    e Zd ZdZed             Zd ZdS )streamz
    The stream API is supported in the simulator - however, all execution
    occurs synchronously, so synchronization requires no operation.
    c              #      K   d V  d S Nr   selfs    r   auto_synchronizezstream.auto_synchronize   s      r   c                     d S r   r   r   s    r   synchronizezstream.synchronize!       r   N)__name__
__module____qualname____doc__r   r    r"   r   r   r   r   r      sH            ^    r   r   c                      d S r   r   r   r   r   r"   r"   %       Dr   c                      dt           _        d S r   )r   closedr   r   r   closer,   )   s    DKKKr   c                      d S r   r   )argskwargss     r   declare_devicer0   -   r)   r   c                  l    t          d           t          ddz             t          ddz             d S )NzFound 1 CUDA deviceszid %d    %20s %40s)r   	SIMULATORz[SUPPORTED]z	%40s: 5.0zcompute capability)printr   r   r   detectr4   1   s@    	
 !!!	
!@
@AAA	+,
,-----r   c                      t           S r   )r   r   r   r   list_devicesr6   7   s    Kr   c                   .    e Zd ZdZddZddZd Zd ZdS )	Eventz
    The simulator supports the event API, but they do not record timing info,
    and all simulation is synchronous. Execution time is not recorded.
    r   c                     d S r   r   r   r   s     r   recordzEvent.recordB   r#   r   c                     d S r   r   r:   s     r   waitz
Event.waitE   r#   r   c                     d S r   r   r   s    r   r"   zEvent.synchronizeH   r#   r   c                 $    t          d           dS )NzSimulator timings are bogusg        r   )r   events     r   elapsed_timezEvent.elapsed_timeK   s    *+++sr   Nr   )r$   r%   r&   r'   r;   r=   r"   rA   r   r   r   r8   r8   =   sd                     r   r8   NFTc                     |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   )fnrG   rE   rF   s    r   
jitwrapperzjit.<locals>.jitwrapperb   s%    !")/+3(-/ / / /r   )rE   rG   )NotImplementedErrorr
   
isinstancelistr	   )func_or_sigrE   rG   argtypesinlinerestyperF   linkboundscheckoptcacherI   s    ``   `     r   jitrU   S   s    
  O!"MNNN!"DEEE 	|K88+t,, 		/ 	/ 	/ 	/ 	/ 	/ 	/
 +fEBBBBr   c               #      K   d V  d S r   r   r   r   r   defer_cleanuprW   k   s       
EEEEEr   rB   )NFFNFNFNNTN)r'   
contextlibr   cudadrv.devicesr   r   r   kernelr	   numba.core.sigutilsr
   warningsr   r.   r   r   r   r   r   objectr   r"   r,   r0   r4   r6   r8   r@   rU   rW   r   r   r   <module>r^      s    & % % % % % 9 9 9 9 9 9 9 9 9 9 " " " " " " , , , , , ,       ! ! ! ! ! ! ! ! ! !G G G G  
 
 
 
 
V 
 
 
	 	 	  	 	 	. . .      F   & 	 ?C9=*.C C C C0 
 
 
 
 
r   