Doubt related to constant memory and texture memory

Hi all,
I have a huge constant data of around 60kB which i need for my kernel. I tried using constant memory to store this but only a small amount of data is being stored rest of the data is zero. My device has 64kB of constant memory space (1.2 compute capability). Is there any restriction on using this memory space?
Also can texture be used to store this data n if yes which is a better way to store this data.


Textures are a good way of storing constant data, particularly if not all threads of a warp access the same element at the same time.
However there should be no problem storing 60kB in constant memory. Can you give more detail (ideally source code) of what you are doing?

Dear Tera,

Thanks for the reply.

This is what my program looks like :

__constant__ int clfInt[4*2135];

__constant__ float clfFloat[3*2135];

void hostFunction(int * clfInt_h,float * clfFloat_h) // assume all variables it needs are passed as arguments


       size_t clfIntBytes = sizeof(int)*4*2135;

       size_t clfFloatBytes = sizeof(float)*3*2135;

cudaMemcpyToSymbol(clfInt, clfInt_h, clfIntBytes);

       cudaMemcpyToSymbol(clfFloat, clfFloat_h, clfFloatBytes );

dim3 blockDim(16,16);

       dim3 gridDim(38,28);




I am not writing kernel code as right now I am not doing anything in the kernel. But when I see the values of the constant data using NSight its values are not correct. Only upto certain numbers values are correct rest values it doesnt show.

Those cudaMemcpy to symbol calls look incorrect (I am surprised they even compile). The correct form of the call can been seen here.