+
    :i%                         ^ RI HtHtHtHtHtHtHt ^ RIH	t	 ^ RI
Ht ^ RIHtHtHt ^ RIt^ RIt^ RIt^ RIt]t]t ! R R]	4      t]P.                  ! 4       t ! R R	4      t ! R
 R4      tR tR# )    )byrefc_charc_char_pc_intc_size_tc_void_pPOINTER)IntEnum)config)
NvrtcErrorNvrtcCompilationErrorNvrtcSupportErrorNc                   F    ] tR t^t^ t^t^t^t^t^t	^t
^t^t^	t^
t^tRtR# )NvrtcResult N)__name__
__module____qualname____firstlineno__NVRTC_SUCCESSNVRTC_ERROR_OUT_OF_MEMORY$NVRTC_ERROR_PROGRAM_CREATION_FAILURENVRTC_ERROR_INVALID_INPUTNVRTC_ERROR_INVALID_PROGRAMNVRTC_ERROR_INVALID_OPTIONNVRTC_ERROR_COMPILATION%NVRTC_ERROR_BUILTIN_OPERATION_FAILURE1NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION/NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION%NVRTC_ERROR_NAME_EXPRESSION_NOT_VALIDNVRTC_ERROR_INTERNAL_ERROR__static_attributes__r       V/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/cuda/cudadrv/nvrtc.pyr   r      sI    M !+,( !"#!",-)895673,.)!#r#   r   c                   @   a  ] tR t^%t o RtR t]R 4       tR tRt	V t
R# )NvrtcProgramz
A class for managing the lifetime of nvrtcProgram instances. Instances of
the class own an nvrtcProgram; when an instance is deleted, the underlying
nvrtcProgram is destroyed using the appropriate NVRTC API.
c                    Wn         W n        R # N)_nvrtc_handle)selfnvrtchandles   &&&r$   __init__NvrtcProgram.__init__+   s    r#   c                    V P                   # r(   )r*   r+   s   &r$   r-   NvrtcProgram.handle/   s    ||r#   c                d    V P                   '       d   V P                  P                  V 4       R # R # r(   )r*   r)   destroy_programr1   s   &r$   __del__NvrtcProgram.__del__3   s"    <<<KK''- r#   )r*   r)   N)r   r   r   r   __doc__r.   propertyr-   r5   r"   __classdictcell____classdict__s   @r$   r&   r&   %   s-     
  . .r#   r&   c                   .  a  ] tR t^8t o RtR]]! ]4      ]! ]4      3R]]]	]	]]! ]	4      ]! ]	4      3R]]! ]4      3R]]]]! ]	4      3R]]]! ]
4      3R]]]	3R]]]! ]
4      3R	]]]	3R
]]]! ]
4      3R]]]	3/
tRtR tR tR tR tR tR tR tRtV tR# )NVRTCa*  
Provides a Pythonic interface to the NVRTC APIs, abstracting away the C API
calls.

The sole instance of this class is a process-wide singleton, similar to the
NVVM interface. Initialization is protected by a lock and uses the standard
(for Numba) open_cudalib function to load the NVRTC library.
nvrtcVersionnvrtcCreateProgramnvrtcDestroyProgramnvrtcCompileProgramnvrtcGetPTXSizenvrtcGetPTXnvrtcGetCUBINSizenvrtcGetCUBINnvrtcGetProgramLogSizenvrtcGetProgramLogNc                2   \         ;_uu_ 4        V P                  f   ^ RIHp \        P                  V 4      ;V n        p V! R4      pTP                  P                  4        FZ  w  rV\        Y54      pT^ ,          Tn        TR,          Tn        \        P                  ! T4      RTRT/R l4       p\        Y%T4       K\  	  R R R 4       V P                  #   \         d   pR T n        \        R4      ThR p?ii ; i  + '       g   i     T P                  # ; i)N)open_cudalibr,   zNVRTC cannot be loaded:   NNfuncnamec                     V ! V!  pV\         P                  8X  d   \        4       hV\         P                  8w  d*    \        V4      P                  pRV RV 2p\        V4      hR#   \
         d
    R T R2p L(i ; i)z"Unknown nvrtc_result (error code: )zFailed to call z: N)r   r   r   r   rL   
ValueErrorr   )rK   rL   argserror
error_namemsgs   $$*   r$   checked_call#NVRTC.__new__.<locals>.checked_callx   s     $d K$G$GG"7"99"k&?&??H-8-?-D-D
 %4D6J<"HC",S/1 @ $. H/>>CWA/G
Hs   A& &A:9A:)_nvrtc_lock_NVRTC__INSTANCEnumba.cuda.cudadrv.libsrI   object__new__OSErrorr   _PROTOTYPESitemsgetattrrestypeargtypes	functoolswrapssetattr)	clsrI   instliberL   protorK   rT   s	   &        r$   rZ   NVRTC.__new__g   s    [~~%@(.s(;;M&w/C $(#3#3#9#9#;KD"3-D#(8DL$)"IDM__T*2 2D 2 +2 D5' $< @ ~~5  M%)CN+,DE1LM [@ ~~s0   1C;C	A8C;C8 C33C88C;;D	c                    \        4       p\        4       pV P                  \        V4      \        V4      4       VP                  VP                  3# )z2
Get the NVRTC version as a tuple (major, minor).
)r   r>   r   value)r+   majorminors   &  r$   get_versionNVRTC.get_version   s=     %,e5{{EKK''r#   c                    \        V\        4      '       d   VP                  4       p\        V\        4      '       d   VP                  4       p\        4       pV P	                  \        V4      W^ RR4       \        W4      # )z0
Create an NVRTC program with managed lifetime.
N)
isinstancestrencodenvrtc_programr?   r   r&   )r+   srcrL   r-   s   &&& r$   create_programNVRTC.create_program   sb     c3**,CdC  ;;=D
 	fs!T4HD))r#   c                4   V Uu. uF  q3P                  4       NK  	  ppV Uu. uF  p\        V4      NK  	  pp\        \        V4      ,          pV! V!  p V P                  VP                  \        V4      V4       R# u upi u upi   \
         d     R# i ; i)z
Compile an NVRTC program. Compilation may fail due to a user error in
the source; this function returns ``True`` if there is a compilation
error and ``False`` on success.
FT)rs   r   lenrA   r-   r   )r+   programoptionsoptencoded_optionsoption_pointersc_options_type	c_optionss   &&&     r$   compile_programNVRTC.compile_program   s     4;;7C::<7;4CDOS8C=OD"S\1"O4		$$W^^S\9M <D % 		s   A>B&B BBc                N    V P                  \        VP                  4      4       R# )z
Destroy an NVRTC program.
N)r@   r   r-   )r+   rz   s   &&r$   r4   NVRTC.destroy_program   s     	  w~~!67r#   c                   \        4       pV P                  VP                  \        V4      4       \        VP
                  ,          ! 4       pV P                  VP                  V4       VP
                  P                  4       # )z)
Get the compile log as a Python string.
)r   rF   r-   r   r   rk   rG   decode)r+   rz   log_sizelogs   &&  r$   get_compile_logNVRTC.get_compile_log   s[     :##GNNE(OD&)4yy!!r#   c                   \        4       pV P                  VP                  \        V4      4       \        VP
                  ,          ! 4       pV P                  VP                  V4       VP
                  P                  4       # )z*
Get the compiled PTX as a Python string.
)r   rB   r-   r   r   rk   rC   r   )r+   rz   ptx_sizeptxs   &&  r$   get_ptxNVRTC.get_ptx   s[     :W^^U8_=&)-yy!!r#   r   )r   r   r   r   r7   nvrtc_resultr	   r   rt   r   r   r\   rW   rZ   rn   rv   r   r4   r   r   r"   r9   r:   s   @r$   r=   r=   8   s     	wu~wu~F 	|]Hh$gh&79JL 	gm.DE 	mU ' 1 3 	L-9JKmX> 	lM78;LM,x@ 	!<#*8#4#6 	|]HEA!KH J!F(*"$8
"
" 
"r#   r=   c                8   \        4       pVP                  W4      pVw  rVRV V 2pR\        P                   2p\        P
                  P                  \        P
                  P                  \        4      4      p	\        P
                  P                  V	4      p
RV
 2pWxVRR.pVP                  WL4      pVP                  V4      pV'       d   RV RV 2p\        V4      hV'       d   RV RV 2p\        P                  ! V4       VP                  V4      pVV3# )aV  
Compile a CUDA C/C++ source to PTX for a given compute capability.

:param src: The source code to compile
:type src: str
:param name: The filename of the source (for information only)
:type name: str
:param cc: A tuple ``(major, minor)`` of the compute capability
:type cc: tuple
:return: The compiled PTX and compilation log
:rtype: tuple
z--gpu-architecture=compute_z-Iz-rdctruez+NVRTC Compilation failure whilst compiling z:

z$NVRTC log messages whilst compiling )r=   rv   r   CUDA_INCLUDE_PATHospathdirnameabspath__file__r   r   r   warningswarnr   )ru   rL   ccr,   rz   rl   rm   archincludecudadrv_pathnumba_cuda_pathnumba_includer{   compile_errorr   rS   r   s   &&&              r$   compiler      s    GE""3-G LE(w7D6++,-G77??277??8#<=Lggool3O)*MmVV<G ))';M 


(C <TF%uMo 5dV5Fc
--
 C8Or#   )ctypesr   r   r   r   r   r   r	   enumr
   
numba.corer   numba.cuda.cudadrv.errorr   r   r   ra   r   	threadingr   rt   r   r   LockrV   r&   r=   r   r   r#   r$   <module>r      sp    N N N  9 9  	    $' $ nn. .&Z" Z"z/r#   