I have this method:
Code :
kernel void myKern(global int* paiOut) // real function has more parameters

inside of the method, I have this:

Code :
    int aiTravel[11514];
    aiTravel[0] = 0;
    int iTravels = 1;

I have a while-loop to fill the "aiTravel"-array with numbers.. it doesn't return error, but the while-loop's "break"-function is supposed to go off depending on the number from "aiTravel[x]". it doesn't ever break, and it loops forever.

anyway, I think the problem is that aiTravel[x] is returning wrong numbers, I did this test:

Code :
                    paiOut[0] = iTravels;
                    paiOut[1] = aiTravel[iTravels];
                    paiOut[2] = aiTravel[2];

then I print these values from c#:
paiOut[0] = 2
paiOut[1] = 2
paiOut[2] = -1

why is paiOut[1] different compared to paiOut[2] ?

I can try to make a complete, simpler kernel to try to reproduce the problem and post full code if you don't understand it. The kernel I am currently using is very big