ptxasvs: program spawns ptxas and alters error output This program makes ptxas' errors Visual St

Hi. This is my first post.
I have searched for a way to have the error messages of ptxas match the format that Visual Stuio wants, in order to use F4 to traverse errors and have the cursor in the edit window automatically move to the error lines in the source .ptx file. With absolutely no success.

So I have written a littly ditty that spawns ptxas and redirects its stderr through a pipe. The parent process then parses the error messages and alters them such that they match what Visual Studio wants. Here’s a small example output:

ptxas:

ptxas matrixMul_kernel.ptx, line 199; error : Result register required for instruction ‘add’
ptxas matrixMul_kernel.ptx, line 199; error : Unknown symbol ‘%r55’
ptxas matrixMul_kernel.ptx, line 200; error : Unknown symbol ‘%r55’
ptxas fatal : Ptx assembly aborted due to errors

ptxasvs:
matrixMul_kernel.ptx(199) : error : Result register required for instruction ‘add’
matrixMul_kernel.ptx(199) : error : Unknown symbol ‘%r55’
matrixMul_kernel.ptx(200) : error : Unknown symbol ‘%r55’
ptxas fatal : Ptx assembly aborted due to errors

The program is not complicated, but I hope you will find it useful.

I have compiled it under Visual Studio 6, UNICODE and non-UNICODE, and under Visual Studio 2008, 32-bit and 64-bit.

I receive no compilation warnings or errors.

I am unaware of any bugs, and have tried to test it quite thoroughly.

I am not uploading executables, as 1: it’s insanely trivial to compile, 2: I assume anyone reading this would rather compile the source.

It is my hope that this program will assist anyone interested in using Visual Studio to write straight ptx.

Regards,
David
ptxasvs.c.txt (6.8 KB)