+
     þÎjŸ  ã                   ó°   € 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   &&&€ÚP/opt/data/home/.local/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   � Ø ŸIœI t§x£xÐ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_callÚ2Runtime._wrap_api_call.<locals>.safe_cuda_api_callM   s/   ø€ ä�M‰MÐ0°%·.±.ÔAÙ˜T‘lˆGØ×Ñ˜e WÖ-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×(Ñ(Ô(Ü—m’m GÐ-?Ó@‰GÛ05²wÐ?ˆCÜ�M‰M˜#ÔÜ% 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   ø€ Ø1ˆCÜ" 3¨¥;Ó/Ð/r   )Úgetattrr.   r5   r:   )r   r;   rV   s   &f r   r6   ÚRuntime._find_api[   sD   ø€ ð	Ü˜4Ÿ8™8 UÓ+Ð+øÜô 	Ùð	úõ
	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Ô1´V×5HÑ5HÈBÔ5Nàˆ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   