+
    :i                         R t ^ RIt^ RIt^ RIt^ RIHt ^ RIHtHt ^ RI	H
t
Ht ^ RIHt ^ RIHt ^ RIHt  ! R R	]4      t ! R
 R4      t]! 4       tR tR# )z
CUDA Runtime wrapper.

This provides a very minimal set of bindings, since the Runtime API is not
really used in Numba except for querying the Runtime version.
N)config)	ERROR_MAPmake_logger)CudaSupportErrorCudaRuntimeError)open_cudalib)API_PROTOTYPES)enumsc                   <   a a ] tR t^t oRtV 3R ltR tRtVtV ;t	# )CudaRuntimeAPIErrorzH
Raised when there is an error accessing a C API from the CUDA Runtime.
c                >   < Wn         W n        \        SV `  W4       R # )N)codemsgsuper__init__)selfr   r   	__class__s   &&&X/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/cuda/cudadrv/runtime.pyr   CudaRuntimeAPIError.__init__   s    	#    c                >    R V P                   : RV P                  : 2# )[z] r   r   r   s   &r   __str__CudaRuntimeAPIError.__str__   s     IItxx00r   r   )
__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes____classdictcell____classcell__)r   __classdict__s   @@r   r   r      s     $
1 1r   r   c                   d   a  ] tR t^!t o RtR tR tR tR tR t	R t
R tR	 t]R
 4       tRtV tR# )Runtimez9
Runtime object that lazily binds runtime API functions.
c                    R V n         R# )FN)is_initializedr   s   &r   r   Runtime.__init__&   s
    #r   c                    \        4       s\        P                  '       d   R p\	        V4      h\        R4      V n        RV n        R# )zzCUDA is disabled due to setting NUMBA_DISABLE_CUDA=1 in the environment, or because CUDA is unsupported on 32-bit systems.cudartTN)r   _loggerr   DISABLE_CUDAr   r   libr(   )r   r   s   & r   _initializeRuntime._initialize)   s?     -%C #3'')"r   c                2    \         V,          pT^ ,          pTR,          pT P                  '       g   T P	                  4        T P                  T4      pY5n        YEn        T P                  Y4      p\        YT4       T#   \         d    \        T4      hi ; i)    :   NN)
r   KeyErrorAttributeErrorr(   r/   	_find_apirestypeargtypes_wrap_api_callsetattr)r   fnameprotor7   r8   libfn	safe_calls   &&     r   __getattr__Runtime.__getattr__7   s    	("5)E (9""" u%!''5	Y'  	( ''	(s   A? ?Bc                N   a aa \         P                  ! S4      VVV 3R  l4       pV# )c                  x   < \         P                  R SP                  4       S! V !  pSP                  SV4       R# )zcall runtime api: %sN)r,   debugr   _check_error)argsretcoder;   r=   r   s   * r   safe_cuda_api_call2Runtime._wrap_api_call.<locals>.safe_cuda_api_callM   s/    MM0%..ATlGeW-r   )	functoolswraps)r   r;   r=   rG   s   fff r   r9   Runtime._wrap_api_callL   s&    			. 
 	. "!r   c                    V\         P                  8w  dB   \        P                  ! VR 4      pRV: RV: 2p\        P                  V4       \        W$4      hR# )cudaErrorUnknownzCall to z results in N)r	   CUDA_SUCCESSr   getr,   errorr   )r   r;   rF   errnamer   s   &&&  r   rD   Runtime._check_errorT   sG    e(((mmG-?@G05w?CMM#%g33	 )r   c                ~   a  \        V P                  S4      #   \         d     Mi ; iT3R  lp\        T ST4       T# )c                  ,   < R p\        VS,          4      h)zruntime missing function: %s.)r   )rE   kwsr   r;   s   *, r   absent_function*Runtime._find_api.<locals>.absent_functionc   s    1C"3;//r   )getattrr.   r5   r:   )r   r;   rV   s   &f r   r6   Runtime._find_api[   sD    	488U++ 		
	0 	e_-s    ''c                    \         P                  ! 4       pV P                  \         P                  ! V4      4       VP                  R,          pVP                  VR,          ,
          ^
,          pW#3# )z=
Returns the CUDA Runtime version as a tuple (major, minor).
i  )ctypesc_intcudaRuntimeGetVersionbyrefvalue)r   rtvermajorminors   &   r   get_versionRuntime.get_versionj   sS     ""6<<#67t#-"4~r   c                <    V P                  4       V P                  9   # )z:
Returns True if the CUDA Runtime is a supported version.
)rc   supported_versionsr   s   &r   is_supported_versionRuntime.is_supported_versionu   s    
 !T%<%<<<r   c                ^    \         P                  R9  g   \        P                  ^@8w  d   R# R# )zrA tuple of all supported CUDA toolkit versions. Versions are given in
the form ``(major_version, minor_version)``.)linuxwin32 ))   r2   )rm   r3   )rm      )rm      )rm      )rm      )rm      )rm      )sysplatformr   MACHINE_BITSr   s   &r   rf   Runtime.supported_versions|   s-     <<11V5H5HB5NI 	r   )r(   r.   N)r   r   r   r   r    r   r/   r?   r9   rD   r6   rc   rg   propertyrf   r!   r"   )r$   s   @r   r&   r&   !   sF     $#*"4	=  r   r&   c                 *    \         P                  4       # )z9
Return the runtime version as a tuple of (major, minor)
)runtimerc   rl   r   r   rc   rc      s       r   )r    r[   rI   rt   
numba.corer   numba.cuda.cudadrv.driverr   r   numba.cuda.cudadrv.errorr   r   numba.cuda.cudadrv.libsr   numba.cuda.cudadrv.rtapir   numba.cuda.cudadrvr	   r   r&   rz   rc   rl   r   r   <module>r      sO      
  < G 0 3 $
1* 
1c cL )!r   