Problem with arrays with dynamic size

Discussion created by edwen on Sep 14, 2010
Latest reply on Sep 29, 2010 by wainwright

In my kernel function, I need to build an array. However, the size of this array is passed as a parameter from the host code. I could not name a constant for it since this value will be input by the users. And the code is somehow like:

__kernel void valuation(__global float *d_v, const int num)



const int num_ = num;

float L_c[num_];



However, this doesn't work and it always gives a programbuild error. Any suggestions would be appriciated. Thanks,