This doesn't crash:
Code :
if ((z >= attributes[18] ) && (y < 1 + .05))

If I remove the first part of that..this crashes:
Code :
if ((y < 1 + .05))

So, attributes[18] is like 10 or something, z is a calculated number, as is y.

It's returning CL_OUT_OF_RESOURCES to the NDRange run.

Contents of if-statement aren't related to the check directly:
Code :
_cellGrid[(W * 600) - (600 - H)].value = .8;

W and H are global ID's from the dimensions...but I replaced that line with
Code :
_cellGrid[(10 * 600) - (600 - 20)].value = .8;

Which is most definitely defined on a 360k length grid, just to be sure that the ID's weren't going into any weird errors, the error still persists, exactly the same.

I'd say "okay, maybe it's a memory issue" if it was crashing when I ADDED the memory access, but it crashes when I REMOVE the memory access. This is a ridiculous problem, I have no idea where to start debugging. I tried disabling compiler optimizations which didn't get me anywhere. Yes, cellGrid access is always defined, I've made sure of that. For some reason that if statement is dying terribly and I cannot figure out why.

If I change the if statement to any constants, it crashes, ie. if (1), if (0). ALL of the above works on the CPU version...Not sure what the heck could make an if statement act this instable.

Any advice?

Card is a GTX280.