I have a question about OpenCl programming. The scenario is : I have a list of words taken from a file with different length and I have to pass this list to OpenCl Kernel. I've tried to use a struct compposed by an array of char that contains the word and an int that contains the size. But this kind of solution doesn't work because, in the Kernel, I must create a new array with the size indicated in the struct, but the Kernel doesn't like arrays of variable size. There is a way to implement this solution (I mean creating one array per thread of different size)? If there is no solution in this way, how can I do? Thank you :)
EDIT : This is the example code.. I hope it clarify the things
typedef struct word{
char word[100];
int len;
}word_t;
__kernel void test(__global word_t *data, __global res_t *result)
{
size_t id=get_global_id(0);
int size=0;
size=data[id].len;
char word[size];
//working with the word
}
But the clBuildProgram says that I cannot have an array with variable size..