12 Replies Latest reply on Sep 29, 2010 5:49 AM by wainwright

    Problem with arrays with dynamic size

    edwen

      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,