gpt4 book ai didi

用于 mex 文件的 cuda nvprof

转载 作者:行者123 更新时间:2023-12-04 14:33:26 26 4
gpt4 key购买 nike

我的程序由一个 Matlab 文件 (.m) 和一个 mex-cuda 文件 (.cu) 组成。它从Matlab开始,然后Matlab文件调用mex-cuda文件。

我想使用“nvprof”命令行在 mex-cuda 文件中分析性能。我知道对于常规的 CUDA 程序,我们只需使用(在 Unix 中):

$nvprof file.out

但是,mex-cuda 文件现在是从 matlab 中调用的,不再是从 shell 中调用的。有没有办法为此 mex-cuda 文件使用“nvprof”命令行?

最佳答案

如果您从命令行运行 matlab,请尝试

nvprof "matlab < myfile.m"

引号可能是不必要的,即这也可以工作:

nvprof matlab < myfile.m

关于用于 mex 文件的 cuda nvprof,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26839417/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com