I just stumbled over the following behavior and I am wondering if it is indented to be like that:
When I specify the directory for include files via -I when building a program (clBuildProgram) and use #include to get the content of another OpenCL file into the current one (source specified using clCreateProgramWithSource), it works perfectly fine. If I then alter the included file and restart the application compiling the program again, the compiler seems to use a cached version of the file, not considering my changes to the file. Even if I delete the file I want to include, the compiler does not complain anymore.
I suppose the compiler caches some intermediate output (eg ptx) to enable faster building of OpenCL code. But in this case, a change detection would be nice.
For you information: I am using CUDA Toolkit 4.1, win7, my driver version is 286.19.
For now, I am just using the c++ api specifying multiple files, but in some cases using #include would be nice.
Anyone experienced the same behavior? Am I doing something wrong?
Ok I found confirmation for that. Under win7 in the folder
you can find the cached files including ptx code. As long as the main file is not altered, the compiler does not recompile the program, even if the included file changes.
This also explains why the compile time is sometimes quite long, but most of the the time pretty short. :)
If a change detection for the included files was included too, it would be even better.