I’m trying to track down the cause of an incorrect result in my execution. The method I’m attempting is probably not the best way to go about doing so but it’s how I would like to do it…
I want to run my code in emulation and output intermediate kernel results to a file. I figured this would be possible as emulation does not touch the device and all of the memory used is host memory.
I attempted to do the following inside of a kernel:
FILE *fp; fp = fopen(outFile, "w"); fprintf(fp, "Testing...\n"); fclose(fp);
Upon compilation I receive an error:
I know that the __cuda_emu namespace was introduced in 2.3 and that 2.2 is not an option due to the “exception handling is disabled” errors. I’ve been told by a classmate that FILE pointers worked from within a kernel in 2.1 or 2.0 but I would rather not revert back to those.
I have tried various casts and namespace tags on the FILE declarations and have not been able to get anything working.
I would appreciate any advice you guys could offer.
Thank you in advance!