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