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