cuda vs 断点_在Visual Studio中调试cuda文件

在Visual Studio中,当尝试使用断点调试从cpp转换为cuda(cu)文件的函数时,遇到无法查看变量的问题。尽管能够暂停执行,但“错误符号未找到”。解决方案是使用Parallel Nsight Visual Studio Edition,这是一个适用于Windows的设备代码调试工具,可以指导如何附加到运行中的进程进行调试。
摘要由CSDN通过智能技术生成

i have a cpp function (function.cpp") which i "mex"-ed. then i open the function.cpp file in visual studio and attach visual studio to a running matlab process.

when i call the function in matlab i am able to set breakpoints in the function.cpp file and step through it observing the variables.

The debugging process breaks down when i change the function to a cuda file (function.cu). Following the process described above i am still able to stop within function.cu but i cannot see any variables. when i try to "watch" a variable it says "Error symbol .. not found"

i have nsight installed in visual studio. question: how can i observe my variables in the file function.cu in the debug mode as i do for the function.cpp file. Is this possible ?

Note that the function.cu is not in a project. it is just a standalone file with cpp code of a function (say somefunction(){}). for debugging purpose i am opening it up in visual studio. i am compiling the function.cu file in matlab using "nvmex -g wrapper.cu" the wrapper.cu is a matlab mexfunction wrapper which makes calls to somefunction() written inside function.cu

解决方案

You're using the VS debugger which is a host debugger, so it doesn't know how to debug device programs. To debug device code in Windows you should look at Parallel Nsight Visual Studio Edition.

You can search the docs for a guide to attaching to a running process, for the current release (2.2) the specific page is here.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值