
    j                     Z    d dl Z ddlmZmZ g dZg dZd Zd Ze j        d             Z	dS )	    N   )check_errorcudart)startstopprofile)gpustarttimestampgpuendtimestamp
gridsize3dthreadblocksizestreamidzenableonstart 0conckerneltracec                  `    t          t                                                                 dS )zStarts cuda profiler data collection.

    .. warning::
        Raises CudaError in case of it is unable to start the profiler.
    N)r   r   cudaProfilerStart     ]/lsinfo/ai/hellotax_ai/base_platform/venv/lib/python3.11/site-packages/torch/cuda/profiler.pyr   r      s(     **,,-----r   c                  `    t          t                                                                 dS )zStops cuda profiler data collection.

    .. warning::
        Raises CudaError in case of it is unable to stop the profiler.
    N)r   r   cudaProfilerStopr   r   r   r   r      s(     ))++,,,,,r   c               #   r   K   	 t                       dV  t                       dS # t                       w xY w)a  
    Enable profiling.

    Context Manager to enabling profile collection by the active profiling tool from CUDA backend.
    Example:
        >>> # xdoctest: +REQUIRES(env:TORCH_DOCTEST_CUDA)
        >>> import torch
        >>> model = torch.nn.Linear(20, 30).cuda()
        >>> inputs = torch.randn(128, 20).cuda()
        >>> with torch.cuda.profiler.profile() as prof:
        ...     model(inputs)
    N)r   r   r   r   r   r   r   &   s8      s   & 6)

contextlib r   r   __all__DEFAULT_FLAGSr   r   contextmanagerr   r   r   r   <module>r      s        ! ! ! ! ! ! ! ! '
&
&  . . .- - -     r   