I have the following CUDA code:
#if 1 //Doesn't print anything printf("(%s:%d): ",filename,line); #else //Prints, but bloated code and interleaved output printf("("); printf("%s",filename); printf(":%d): ",line); #endif
The one-liner prints nothing. The second one works, but output from multiple threads becomes interleaved. I conclude that something is broken with the
"%s" specifier implementation.
What’s going on? Can this be fixed and/or worked around?
Additional details that may be relevant but probably aren’t: