Dynamic const memory

Hi everybody, until now I only use constant as a static array.
for example “device constant float constData[N_ELEMENTS];”
in that case the N_ELEMENTS must be a constant value.
In some case N_ELEMENTS is not a constant value, so how can I allocate a dynamic array?
thank you.


Declaring it statically is the only way to use the constant memory.

To get dynamic allocation you will have to write an allocator yourself.