
    
9j                        S SK Jr  S SKrS SKrS SKr\R
                  " 5       r " S S\5      rS r	S r
\R                  S 5       rg)    )annotationsNc                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )DeviceSynchronized   zRaised when device synchronization is detected while disallowed.

.. warning::

   This API has been deprecated in CuPy v10 and will be removed in future
   releases.

.. seealso:: :func:`cupyx.allow_synchronize`

c                .   > Uc  Sn[         TU ]  U5        g )Nz5Device synchronization was detected while disallowed.)super__init__)selfmessage	__class__s     O/home/wildlama/miniconda3/lib/python3.13/site-packages/cupy/_core/syncdetect.pyr	   DeviceSynchronized.__init__   s    ?MG!     N)__name__
__module____qualname____firstlineno____doc__r	   __static_attributes____classcell__)r   s   @r   r   r      s    	" "r   r   c                 Z     [         R                  $ ! [         a    S[         l         gf = f)NT)_thread_localallowedAttributeErrorr   r   r   _is_allowedr      s-    $$$  $s    **c                 6    [        5       (       d
  [        5       eg r   )r   r   r   r   r   _declare_synchronizer   &   s     == "" r   c              #     #    [         R                  " S5        [        5       nU [        l         Sv   U[        l        g! U[        l        f = f7f)a  Allows or disallows device synchronization temporarily in the current thread.

.. warning::

   This API has been deprecated in CuPy v10 and will be removed in future
   releases.

If device synchronization is detected, :class:`cupyx.DeviceSynchronized`
will be raised.

Note that there can be false negatives and positives.
Device synchronization outside CuPy will not be detected.
zucupyx.allow_synchronize will be removed in future releases as it is not possible to reliably detect synchronizations.N)warningswarnr   r   r   )allowolds     r   allow_synchronizer%   -   sB       MM	?@ -C!M$ #s   ,A? AAA)
__future__r   
contextlib	threadingr!   localr   RuntimeErrorr   r   r   contextmanagerr%   r   r   r   <module>r,      sO    "    !" "$# $ $r   