Question about constant device memory

Hi,

i have a question regarding constant device memory:

My code repeatedly runs different kernels inside a loop.
Every kernel uses its own constant memory.

I initialize the constant memory for every kernel only once at program start using setup functions in every kernel implementation file.

Is this o.k.? Up to now i got no problems, but i want to be on the safe side.

Do the constant memories anyhow overlap?

Is the constant memory amount imit per kernel or per application?
Is it only like global static data + caching or is it a private cached data area on the device?

So: What exactly does constant memory do on the card and when is it freed?

Thanks in advance.

Hi,

I don’t think “constant memories” could overlap.

Constant memory is a 3-level cache (the L1 cache is 2 kb large as far as I remember)

The limit is not by kernel.

A part of the constant memory is used to store your kernel instructions for execution, but you never have to worry about that, because CUDA will never give you access to this part.

Hi,

I don’t think “constant memories” could overlap.

Constant memory is a 3-level cache (the L1 cache is 2 kb large as far as I remember)

The limit is not by kernel.

A part of the constant memory is used to store your kernel instructions for execution, but you never have to worry about that, because CUDA will never give you access to this part.