我可以找到我的代码的哪一行使用cudaMemcpy生成错误吗?

时间:2019-05-09 13:04:21

标签: c++ cuda

我正在Cuda中编写代码。在我的代码中,我有很多共享变量和全局变量,很难找到我的错误。 我使用cuda-memcheck来查看我遇到的错误。

结果是这样的:

========= Invalid __local__ read of size 8   <br>
=========     at 0x00006908 in c:\\cuda_scheduler\/LocalThread.h:410:virtualcounter1(Task*, unsigned int*, unsigned int*, unsigned int*, int*, unsigned int*, int*, unsigned int*, unsigned int*, char*, bool*, int*, char*)<br>
=========     by thread (32,0,0) in block (0,0,0)<br>
=========     Address 0x00fffcc0 is out of bounds<br>
=========     Saved host backtrace up to driver entry point at kernel launch time<br>
=========     Host Frame:C:\WINDOWS\system32\nvcuda.dll (cuD3D9UnmapVertexBuffer + 0x1aee5a) [0x1bd195]<br>
=========     Host Frame:c:\\cuda_scheduler\kernel.exe [0x1cac]<br>
=========     Host Frame:c:\\cuda_scheduler\kernel.exe [0x1644]<br>
=========     Host Frame:c:\\cuda_scheduler\kernel.exe [0x1008b]<br>
=========     Host Frame:c:\\cuda_scheduler\kernel.exe [0xff1f]<br>
=========     Host Frame:c:\\cuda_scheduler\kernel.exe [0xf182]<br>
=========     Host Frame:c:\\cuda_scheduler\kernel.exe [0xf6db]<br>
=========     Host Frame:c:\\cuda_scheduler\kernel.exe [0x189a5]<br>
=========     Host Frame:C:\WINDOWS\System32\KERNEL32.DLL (BaseThreadInitThunk + 0x14) [0x17974]<br>
=========     Host Frame:C:\WINDOWS\SYSTEM32\ntdll.dll (RtlUserThreadStart + 0x21) [0x6a271]<br>

我可以找到发生错误的那一行吗?还是我必须逐行跟踪?

0 个答案:

没有答案