cupy.cuda.profile#
- cupy.cuda.profile()[source]#
在使用 with 语句时启用 CUDA 性能分析。
此函数在进入 with 语句时启用性能分析,并在离开该语句时禁用性能分析。
>>> with cupy.cuda.profile(): ... # do something you want to measure ... pass
注意
从命令行启动
nvprof
时,可能需要手动设置--profile-from-start off
以获得所需行为。警告
此上下文管理器已弃用。请改为使用
cupyx.profiler.profile
。