Hi Martin,

On Tue, 30 Aug 2011 15:28:50 +0200, "Bergtholdt, Martin" 
<[email protected]> wrote:
> I think I start getting a clue where the errors in test_driver come from:
> 
> Preprocess_source evidently should return the preprocessed source code, which 
> it doesn't on my machine:
> 
> nvcc --preprocess -arch sm_20 -m32 
> -IC:\\Python26\\lib\\site-packages\\pycuda-2011.1.3-py2.6-win32.egg\\pycuda\\..\\include\\pycuda
>  c:\\users\\dep14422\\appdata\\local\\temp\\tmptzcgj9.cu --compiler-options -P
> tmptzcgj9.cu
> 
> it just outputs the tmptzcgj9.cu filename.
> 
> Since the output is then used as hash, I don't think that this is the 
> intended behavior it rather seems that gcc outputs with the -E option the 
> result of preprocessing to stdout.
> 
> I also got the culprit:
> 
> "To send the preprocessed output to a file instead of to stdout, use the /P 
> (Preprocess to a File) option instead."
> 
> So cl outputs to a file *.i (tmptzcgj9.i) in the current directory (I now 
> have a bunch of them in my test/ directory), because of the -P. It should be 
> -EP:
> 
> "To suppress #line directives, use the /EP (Preprocess to stdout Without 
> #line Directives) option instead."
> 
> Edited -P to -EP: works!

Thanks for your detective work on this. I think we should use two
different approaches here. First, we should probably do a plausibility
check on the preprocessed source (<0.5x the length of un-preprocessed,
e.g.) and error out in case of failure. Second, we should pass -EP if
we're on Windows. (sys.platform == 'win32')

Can you try and hack up a patch?
Thanks,
Andreas

Attachment: pgpG2m5zYWDWC.pgp
Description: PGP signature

_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to