
    `i
                     ^    d dl Z d dlZd dlmZ e j        dd            Z G d d          ZdS )    N)
time_rangeFc              #      K   t          j        d           t          | |||          5  dV  ddd           dS # 1 swxY w Y   dS )a  A context manager to describe the enclosed block as a nested range

    >>> from cupy import prof
    >>> with cupy.prof.time_range('some range in green', color_id=0):
    ...    # do something you want to measure
    ...    pass

    Args:
        message: Name of a range.
        color_id: range color ID
        argb_color: range color in ARGB (e.g. 0xFF00FF00 for green)
        sync (bool): If ``True``, waits for completion of all outstanding
            processing on GPU before calling :func:`cupy.cuda.nvtx.RangePush()`
            or :func:`cupy.cuda.nvtx.RangePop()`

    .. seealso:: :func:`cupy.cuda.nvtx.RangePush`
        :func:`cupy.cuda.nvtx.RangePop`

    .. warning:: This context manager is deprecated. Please use
        :class:`cupyx.profiler.time_range` instead.
    zcupy.prof.time_range has been deprecated since CuPy v10 and will be removed in the future. Use cupyx.profiler.time_range instead.N)warningswarn_time_range)messagecolor_id
argb_colorsyncs       i/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/cupy/prof/_time_range.pyr   r      s      . M	  
 
Wh
D	9	9                   s   ;??c                   d    e Zd ZdZej        Zej        Zej        Zej	        Z	ej
        Z
	 	 ddZdS )TimeRangeDecoratoraZ  Decorator to mark function calls with range in NVIDIA profiler

    Decorated function calls are marked as ranges in NVIDIA profiler timeline.

    >>> from cupy import prof
    >>> @cupy.prof.TimeRangeDecorator()
    ... def function_to_profile():
    ...     pass

    Args:
        message (str): Name of a range, default use ``func.__name__``.
        color_id: range color ID
        argb_color: range color in ARGB (e.g. 0xFF00FF00 for green)
        sync (bool): If ``True``, waits for completion of all outstanding
            processing on GPU before calling :func:`cupy.cuda.nvtx.RangePush()`
            or :func:`cupy.cuda.nvtx.RangePop()`

    .. seealso:: :func:`cupy.cuda.nvtx.RangePush`
        :func:`cupy.cuda.nvtx.RangePop`

    .. warning:: This decorator is deprecated. Please use
        :class:`cupyx.profiler.time_range` instead.
    NFc                 ^    t          j        d           |                     ||||           d S )Nzcupy.prof.TimeRangeDecorator has been deprecated since CuPy v10 and will be removed in the future. Use cupyx.profiler.time_range instead.)r   r   _init)selfr   r	   r
   r   s        r   __init__zTimeRangeDecorator.__init__F   s=     		 	 	
 	

7Hj$77777    )NNNF)__name__
__module____qualname____doc__r   r   r   	__enter____exit____call___recreate_cm r   r   r   r   '   sb         0  E%I#H#H+L?C8 8 8 8 8 8r   r   )NNF)
contextlibr   cupyx.profilerr   r   contextmanagerr   r   r   r   <module>r       s         4 4 4 4 4 4    >'8 '8 '8 '8 '8 '8 '8 '8 '8 '8r   