I am working with CUDA on a windows platform. I had a query regarding initialization of an array on shared memory. If the array is initialized as follows :__shared float Array[16 * 16] it works fine. But when I try to pass in the size of the array as an argument to the kernel function (for example __shared float Array [m] where m is passed in as an argument) it results in a build error: expression must have a constant value. Is it not possible to declare the size of the array on the fly? I tried using the extern __shared float declaration but I am using quite a few variables and am facing memory overlap problems. I would greatly appreciate any help.