o
    i
                     @   s>   d dl Z d dlZd dlmZ e jdddZG dd dZdS )	    N)
time_rangeFc                 c   sF    t d t| ||| dV  W d   dS 1 s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sync r
   R/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/cupy/prof/_time_range.pyr      s   "r   c                   @   s<   e Zd ZdZejZejZejZej	Z	ej
Z
		d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                 C   s   t 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	   r
   r
   r   __init__F   s   zTimeRangeDecorator.__init__)NNNF)__name__
__module____qualname____doc__r   r   r   	__enter____exit____call___recreate_cmr
   r
   r
   r   r   '   s    r   )NNF)
contextlibr   cupyx.profilerr   r   contextmanagerr   r
   r
   r
   r   <module>   s    