Does anyone know how to enable C source code comments in PTX output? The PTX output I get does not contain the source code and looks like this. Thanks
ld.param.u32 $r2, [__cudaparm_k_radius]; // id:58 __cudaparm_k_radius+0x0
mov.s32 $r3, 2; //
mul24.lo.s32 $r4, $r3, $r2; //
cvt.u32.u16 $r5, %tid.x; //
sub.u32 $r6, $r5, $r2; //
mul24.lo.u32 $r7, $r5, 4; //
cvt.u32.u16 $r8, %ntid.x; //
sub.u32 $r9, $r8, $r4; //
add.u32 $r10, $r7, $r1; //
cvt.s32.u16 $r11, %ctaid.x; //
mul24.lo.s32 $r12, $r9, $r11; //
add.s32 $r13, $r12, $r6; //
ld.param.s32 $r14, [__cudaparm_zdim]; // id:62
This is in the FAQ (Q23), but actually it was incorrect. The options you need to add to the nvcc command line are:
–opencc-options -LIST:source=on
[url=“http://forums.nvidia.com/index.php?showtopic=36286”]http://forums.nvidia.com/index.php?showtopic=36286[/url]
Thanks for the quick response. I still don’t get the C code in the ptx file. Here is an example of a command line that I am using, am I missing something?
C:\CUDA\bin\nvcc.exe --opencc-options -LIST:source=on -ccbin “D:\Program Files\Microsoft Visual Studio 8\VC\bin” -ptx -DWIN32 -D_MBCS -Xcompiler /EHsc,/W3,/nologo,/Wp64,/O2,/Zi,/MT -I"C:\CUDA\include" -I./ -I"C:\Program Files\NVIDIA Corporation\NVIDIA CUDA SDK/common/inc" -I"D:\Program Files\MATLAB\R2006b\extern\include" -o Release\cuda.ptx cuda.cu