Error in cuda c program

I am trying to learn Cuda C programming. I have successfully written a code involving many matrix operations. For matrix size = 256x256, my program is working. when I used matrix size = 512x512 then it gives me the following error message during compilation-

CUDA error at code=700(cudaErrorIllegalAddress) “cudaMemcpy(d_shirinR, shirinR, mem_size1, cudaMemcpyHostToDevice)”

I shall very much appreciate if one can help me how to resolve this issue.

The specifications of my machine is attached.
GPUDetails.pdf (38.0 KB)

Ratan K Saha
IIIT Allahabad