CL_OUT_OF_RESOURCES problem when the expression gets too long? CL_OUT_OF_RESOURCES

hello guys,

i’m trying to put my runge kutta integration code on the gpu with opencl. here is an introduction of the algorithm [url=“Runge–Kutta methods - Wikipedia”]http://en.wikipedia.org/wiki/Runge–Kutta_methods[/url] if you are not familiar with runge kutta

but that is not important. the point is, one of the expressions is this one:

result.x=pos.x +(k1.x+k2.x2.0f+k3.x3.0f+k4.x)*(1.0f/6.0f);

where “result”, “pos”, “k1”, “k2” and “k3” are all vectors defined as this:

typedef struct
{
float x;
float y;
float z;
} Vector;

my code compiles, but has a runtime error, code -5 CL_OUT_OF_RESOURCES at this line.

i don’t know how i can solve this problem. and i don’t know what the problem is?
thanks

i’m guessing that i may use up all the registers of the gpu?

i tried to replace that line with simpler equations, the code can run. but if i use the original equation, the code doesn’t run.

What is your work group size? clGetKernelWorkGroupInfo(), OpenCL specification section 5.5.3, using CL_KERNEL_WORK_GROUP_SIZE value for the cl_kernel_work_group_info should tell you how big you can make this.