Caching of source files

When writing code with multiple source files, for example

“fox.cl”


struct Tango {
   float4 donut;
   float4 snow;
};

“mykernel.cl”


#include "fox.cl"
__kernel void myKernel(__global struct *Tango)
{
    // do some work on Tango structs
}

Now if I were to change something in fox.cl, for example


struct Tango {
   float4 donut;
   float4 snow;
   float4 wood;
};

Quite often it the change will not be recognized when I rebuild the program. Trying to access member wood will return an error. However if I instead add something entirely new, like


struct Tango {
   float4 donut;
   float4 snow;
   float4 wood;
};

struct Swing {
   float4 bread;
   float4 rain;
   float4 brick;
};

The new struct will be recognized with all the members (however wood is typically still unacessible).

Now I haven’t found much info about how OpenCL caches the source in the documentations. I’m guessing it is platform dependent. I’m having trouble figuring out what is wrong since the problem does not occur consistently.

Does anyone have a clue as to what is going on here?

If anyone got the same problem I sort of solved it by deleting everything in NVIDIA\ComputeCache every time I change source files that #included.