我成功地使用cuda-memcheck来检测错误的内存访问。在编译cuda代码时,使用-g -G参数可以得到类似以下的良好源代码位置:
========= Error: process didn't terminate successfully
========= Invalid __global__ read of size 1
========= at 0x00000710 in /some/path/somefile.cu:117:some_function
========= by thread (0,14,0) in block (1,16,0)
========= Address 0x00abac20 is out of bounds
现在我尝试使用-l开关来获取内存泄漏信息。然而,在这里,我只能获得地址:
========= CUDA-MEMCHECK
========= Leaked 3630 bytes at 0x007d2800
=========
========= Leaked 14740 bytes at 0x008e0700
...
=========
========= LEAK SUMMARY: 11122140 bytes leaked in 39 allocations
========= ERROR SUMMARY: 0 errors
400 bytes at 0x005d2000
我该如何从中获取实际的代码位置?