Allocate Array in kernel

Discussion created by Sheeep on Feb 13, 2010
Latest reply on Mar 3, 2010 by gaurav.garg


i tried to allocate an array in the a kernel.

the array's length is a kernel parameter:

__kernel void array(__global int *length){

    int a[length[0 ]];



when i run the kernel i get an error: clProgrammBuild(-11).


i changed type of a to __local int a[length[0]]. and it works.

but i don't want a __local array in this code.

What can i do?