An array arr is passed to the kernel with some data. Inside the kernel I need a temporary array of the same size as arr. How can I allocate it? I tried to pass the size of arr from host to the kernel and to allocate an array with
Code :
float tmp[arrSize]
but the compiler doesn't accept this because arrSize is not a compile time constant. malloc() is not supported by OpenCL C.

How can I create a temporary array of the same size as an existing one inside a kernel?