L ia tddlZddlZddlZddlmZmZgdZgdZd dZdZ dZ ejd Z y) N) check_errorcudart)initstartstopprofile)gpustarttimestampgpuendtimestamp gridsize3dthreadblocksizestreamidzenableonstart 0conckerneltracect}t|ds tdttjdr]tjj Ct tjj jdddk\r td|tn|}|dk(r|jj}n'|d k(r|jj}n td tjd 5}|jd j!d|D|j#t%|j'|j(||dddy#1swYyxYw)NcudaOutputModez-HIP does not support profiler initialization!cuda.r z.CUDA12+ does not need profiler initialization! key_valuecsvz;supported CUDA profiler output modes are: key_value and csvT)delete c3>K|]}|jdyw)asciiN)encode).0fs Y/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/torch/cuda/profiler.py zinit..-s<188G,>> # 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)rrr8r9rr r Ds   s, , ),)Nr) contextlibr*r"rr__all__r&rrrcontextmanagerr r8r9rrAsI ! / V6.- r9