Global Memory to constant memory

When we declare the constant memory, do we have to declare it with a fixed size?
e.g. constant double cache[100];

Can we still declare it using the pointer and allocate memory dynamically?

e.g. constant double *cache;

Is it possible to copy data generated in Global Memory to Constant memory?

When we declare the constant memory, do we have to declare it with a fixed size?
e.g. constant double cache[100];

Can we still declare it using the pointer and allocate memory dynamically?

e.g. constant double *cache;

Is it possible to copy data generated in Global Memory to Constant memory?

I don’t think so. The compiler might need to know how much constant memory to set aside for all the threads.

If you do that, it’s just the pointer that’s in constant memory. Trying to assign something to that pointer would be wrong too, it’s read-only.

I think it can be done between kernel launches. Again, the constant memory itself must be statically allocated.

I don’t think so. The compiler might need to know how much constant memory to set aside for all the threads.

If you do that, it’s just the pointer that’s in constant memory. Trying to assign something to that pointer would be wrong too, it’s read-only.

I think it can be done between kernel launches. Again, the constant memory itself must be statically allocated.