I'm currently having some issues with my opencl code, when i'm trying to pass in a large (is it?) global work space.

This is my kernel
Code :
kernel void intersection(constant REAL2 *polygon1, int numPoints1, constant REAL2 *polygon2, int numPoints2, global REAL2 *offsets, int numOffsets, double tolerance, REAL linearPrecision, BOOL doingInner, REAL area1, REAL area2, global BOOL *intersects, global BOOL *hasInside, global BOOL *hasOutside, global REAL *dummy)
{
// nothing in here!!
}

now, when i implement a globalws of, say (128,128,16) my code runs fine.
But when using a large globalws of say, (1000000, 1000000, 1) , when waiting for the queue to finish, it errors with invalid command queue

Code :
// as an example:
 
cl::NDRange globalws(1000000, 10000000, 1), localws = cl::NullRange;
cl::NDRange globalws(128, 128, 16) , localws = cl::NullRange;
 
// run the kernel
cl_int err = queue->enqueueNDRangeKernel(intersectKernel, cl::NullRange, globalws, localws);

the code works fine for smaller numbers. I make sure that i'm not trying to access an element in an array that doesn't exist. In-fact, i've removed all code in the kernel to see if i get these queue fails, and indeed it does (so it's not the kernel code).

I'm assuming it's a memory problem....... ??