cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

edwen
Journeyman III

Problem with arrays with dynamic size

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,

 

0 Likes
12 Replies