Crash when accessing struct fields

Hello again,

Wow my first experience with open cl its wealth of annoying and weird crashes:\

Now I got an OUT_OF_RESOURCES (the most common error when something is bad on GPU code, for me) when accessing a struct field. Here is the code snippet explaining what works and what does not work:

__kernel void RunSimulation(__global char* outBuffer,

		__global int* numberOfChilds,

		__global Event* currentList,

		__global Event* schedulerList,

		__global Model* models,

		__global int* indexDiagraph,

		__global int* diagraph,

		int bufferSize,

		int clock) {

unsigned int idx = get_global_id(0);

	if(idx >= MAX_EVENTS)

	  return;

if(!currentList[idx].dirty && currentList[idx].time <= clock) { 

	  for(int j=0; j< numberOfChilds[currentList[idx].origId]; j++) {

		  if(models[diagraph[indexDiagraph[currentList[idx].origId] + j]].type == NOT_GATE) {

									  event = schedulerList[idx]; /***WORKING*****/

									  schedulerList[idx].dirty = 0; /****NOT WORKING*****/	 

		  }

But I’ve one more clue about what is working or not. If I move the code, that do not work, out of the if, it starts working,

if(!currentList[idx].dirty && currentList[idx].time <= clock) { 

	  for(int j=0; j< numberOfChilds[currentList[idx].origId]; j++) {

								  schedulerList[idx].dirty = 0; /****NOW ITS WORKING*****/	 

		  }

Event struct is defined:

typedef struct Event {

	short dirty;

	short origId;

	int time;

	int out;

}__attribute__ ((aligned(16))) Event;

Driver: NVIDIA UNIX x86_64 Kernel Module 195.36.15 on Fedora 12

Sorry about English.

Thank you

—> schedulerList[idx],dirty = 0; /NOT WORKING*/ looks like you put a comma instead of a dot before dirty ?

Ups sorry, but the mistake only happens here:\ Unfortunately,I’m not getting a syntactic error:/

Additional info:

when I’ve changed ‘models’ buffer to constant memory, it starts working… But unfortunately, I need it on global memory because I need to perform writes somewhere in the code:( And the 64kb for Constant memory will be too small for future developments of my system…

Hoping that this is not a bug in drivers and you can point me the right way to solve it:\

Thank you