Is it possible to create arrays dynamically in kernel??

Generally, we use temporary arrays in kernel which their sizes are decieded in compilation time like follows:


const int size = 100;

globla void kernel()
{
int array;
}

My question is that can we decied the size of the array in run time? Something like:


global void kernel(int size)
{
int *array = new int;
}

If we can, is the performance of dynamic arrays lower than the static ones??

Thanks in advance!

Yes. and Yes.