
    
9j7                    z   S SK Jr  S SKrS SKrS SKrS SKrS SKr	S SK
Jr  S SK
Jr  S SK
Jr  S SK
Jr  S SKJr  S SKJr  S S	KJr  S S
KJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  Sq " S S5      r S SKJ!r!   S SKJ"r"   S SKJ$r$  S r%S r&S@S jr'S SK(J)r)  S SK(J*r*  S S K(J+r+  S S!K,J-r-  S S"K,J.r.  S S#K/J0r0  S S$K/J1r1  S S%K/J2r2  S S&K/J3r3  S S'K/J4r4  S S(K/J5r5  S S)K/J6r6  S S*K/J7r7  S S+K/J8r8  S S,K/J9r9  S S-K/J:r:  S S.K/J;r;  S S/K/J<r<  S S0K/J=r=  S S1K/J>r>  S S2K?J@r@  S S3KAJBrB  S S4KAJCrC  S S5KAJDrD  S S6KAJErE  S S7KAJFrF  S S8KGJHrH  S S9KGJIrI  S S:KGJJrJ  S S;KGJKrK  S S<KGJLrL  S S=KMJNrN  \R                  SAS> j5       rP\R                  S? 5       rQg! \# a    \ " S5      r" GN
f = f! \# a    \ " S5      r$ GNf = f)B    )annotationsN)get_cuda_path)get_nvcc_path)get_rocm_path)get_hipcc_path)compiler)device)function)memory)memory_hook)memory_hooks)pinned_memory)profiler)stream)texture)driver)runtime)nvrtcc                      \ rS rSrSrS rSrg)_UnavailableModule   Fc                    Xl         g N__name__)selfnames     L/home/wildlama/miniconda3/lib/python3.13/site-packages/cupy/cuda/__init__.py__init___UnavailableModule.__init__"   s        r   N)r   
__module____qualname____firstlineno__	availabler   __static_attributes__ r!   r   r   r      s    Ir!   r   )cub)nvtxzcupy.cuda.nvtx)thrustzcupy.cuda.thrustc                   U S:X  a  SSK Jn  U[        R                  l        U$ U S:X  a  SSK Jn  U[        R                  l        U$ U S:X  a  SSK Jn  U[        R                  l        U$ U S:X  a  SS	K Jn  U[        R                  l        U$ U S
:X  aZ  [        R                  (       d#  [        R                  " 5       S:  a
  SS KJs  Jn  O[        S5      nU[        R                  l        U$ U S:X  aC  [        R                  (       d  SSKJn   UR                  S5        [,        R.                  " S5      $ [0        4 H  nSR3                  UR4                  R7                  S5      S   5      n	X	:X  d  M7  [8        R:                  " SR3                  XR4                  5      [<        5        [?        U[        5      (       + s  $    [A        SR3                  [4        U 5      5      e! UR                    ac  n["        R$                  R'                  S5      S:X  d5  ["        R$                  R'                  S5      c  [)        [+        U5      5      Ue S nAGN.S nAff = f)Ncusolverr   )r,   cusparse)r-   curand)r.   cublas)r/   jitifyzcupy.cuda.jitifycufft)
pathfinderREADTHEDOCSTrueCUPY_CIzcupy.cuda.cufftz
{}_enabled.z
cupy.cuda.{} has been deprecated in CuPy v8 and will be removed in the future release.
Use {}.available instead.
                z!module '{}' has no attribute '{}')!cupy_backends.cuda.libsr,   _cupycudar-   r.   r/   r   is_hipr   get_build_versioncupy.cuda.jitifyr0   r   r2   load_nvidia_dynamic_libDynamicLibNotFoundError_osenvirongetImportErrorstr
_importlibimport_moduler)   formatr   splitwarningswarnDeprecationWarning
isinstanceAttributeError)
keyr,   r-   r.   r/   r0   r2   emodflags
             r   __getattr__rR   4   s   
j4&

	
	4&

	2"

	2"

	~~&":":"<q"@--'(:;F"

	~~'5227;
 ''(9:: v""3<<#5#5c#:2#>?;MM  F4.0BD "#'9:::  +228SAC C# 55 576A [[__Y7C%c!f-145s   G   I0AIIc                     [         c!  Sq  [        R                  " 5       S:  q [         $ [         $ ! [         a     [         $ f = f)NFr   )
_availabler   getDeviceCount	Exceptionr'   r!   r   is_availablerW   f   sL    
	 //1A5J :  		s   / 
A Ac                 ,    [         R                  " 5       $ )ai  
Returns the version of the CUDA Runtime installed in the environment.

Unlike :func:`cupy.cuda.runtime.runtimeGetVersion`, which returns the
CUDA Runtime version statically linked to CuPy, this function returns the
version retrieved from the shared library installed on the host.
Use this method to probe the CUDA Runtime version installed in the
environment.
)r   _getLocalRuntimeVersionr'   r!   r   get_local_runtime_versionrZ   q   s     **,,r!   )Device)get_cublas_handle)get_device_id)Function)Module)alloc)
BaseMemory)malloc_managed)malloc_async)ManagedMemory)Memory)MemoryAsync)MemoryPointer)
MemoryPool)MemoryAsyncPool)PythonFunctionAllocator)CFunctionAllocator)set_allocator)get_allocator)UnownedMemory)
MemoryHook)alloc_pinned_memory)PinnedMemory)PinnedMemoryPointer)PinnedMemoryPool)set_pinned_memory_allocator)Event)get_current_stream)get_elapsed_time)Stream)ExternalStream)Graphc              #     #    U c  [         R                  n [         R                  " 5       n[         R                  " U 5         Sv   [         R                  " U5        g! [         R                  " U5        f = f7f)a  Sets a thread-local allocator for GPU memory inside
   context manager

Args:
    allocator (function): CuPy memory allocator. It must have the same
        interface as the :func:`cupy.cuda.alloc` function, which takes the
        buffer size as an argument and returns the device buffer of that
        size. When ``None`` is specified, raw memory allocator will be
        used (i.e., memory pool is disabled).
N)r   _malloc_get_thread_local_allocator_set_thread_local_allocator)	allocatorprevious_allocators     r   using_allocatorr      sY      NN	;;=
&&y1?**+=>**+=>s   ?A8A A8A55A8c               #     #    [         R                  " S5        [        R                  " 5          Sv   [        R                  " 5         g! [        R                  " 5         f = f7f)a  Enable CUDA profiling during with statement.

This function enables profiling on entering a with statement, and disables
profiling on leaving the statement.

>>> with cupy.cuda.profile():
...    # do something you want to measure
...    pass

.. note::
    When starting ``nvprof`` from the command line, manually setting
    ``--profile-from-start off`` may be required for the desired behavior.

.. warning:: This context manager is deprecated. Please use
    :class:`cupyx.profiler.profile` instead.
z{cupy.cuda.profile has been deprecated since CuPy v10 and will be removed in the future. Use cupyx.profiler.profile instead.N)rI   rJ   r   startstopr'   r!   r   profiler      s>     $ MM	
 NNs   ,A#A	 A#	A  A#)returnintr   )R
__future__r   
contextlib	importlibrE   osr@   rI   cupyr9   cupy._environmentr   r   r   r   	cupy.cudar   r	   r
   r   r   r   r   r   r   r   cupy_backends.cuda.apir   r   r8   r   rT   r   r(   r)   rC   r*   rR   rW   rZ   cupy.cuda.devicer[   r\   r]   cupy.cuda.functionr^   r_   cupy.cuda.memoryr`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   cupy.cuda.memory_hookro   cupy.cuda.pinned_memoryrp   rq   rr   rs   rt   cupy.cuda.streamru   rv   rw   rx   ry   cupy.cuda.graphrz   contextmanagerr   r   r'   r!   r   <module>r      sO   "      + + + ,     ! " #    ) * ) 
  0,4 
/Cd
- $ . * ' % " ' + ) * # ( * ' , 4 / * * * , 7 0 7 4 ? " / - # + ! ? ?.  _  0./D0
  4 23F4s$   F F( F%$F%(F:9F: