o
    ei                     @   sJ   d dl Z ddlmZmZ g dZg dZdd Zdd	 Ze jd
d Z	dS )    N   )check_errorcudart)startstopprofile)gpustarttimestampgpuendtimestamp
gridsize3dthreadblocksizestreamidzenableonstart 0conckerneltracec                   C      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 r   r   ]/var/www/addictedbytheproject.nl/epg/venv/lib/python3.10/site-packages/torch/cuda/profiler.pyr         r   c                   C   r   )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      r   r   c                   c   s$    zt   dV  W t  dS t  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
   r   )

contextlib r   r   __all__DEFAULT_FLAGSr   r   contextmanagerr   r   r   r   r   <module>   s   		