
    9j                     \    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	y)	    N   )check_errorcudart)startstopprofile)gpustarttimestampgpuendtimestamp
gridsize3dthreadblocksizestreamidzenableonstart 0conckerneltracec                  F    t        t               j                                y)zStarts cuda profiler data collection.

    .. warning::
        Raises CudaError in case of it is unable to start the profiler.
    N)r   r   cudaProfilerStart     S/media/conek/DATA/Code/OCR/venv/lib/python3.12/site-packages/torch/cuda/profiler.pyr   r      s     **,-r   c                  F    t        t               j                                y)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               #   \   K   	 t                d t                y# t                w xY w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   &   s     s   , ,),)

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