Error using mex in Matlab: An illegal memory access was encountered

Hi
My system is is Tesla K80,cuda toolkit 7.0 CentOS.
I wanted to implement other’s codes on my system. First, I concatenate all the c and cu files into test.cu, then compile test.cu into a single mex for matlab to call by using makefile. Back when the codes were developing, cuda has to be compiled through other compilers, the makefile use nvopts.sh and nvmex. I just downloaded them from this site http://deep-learning-faces.googlecode.com/svn/trunk/Matlab_Cuda_1.1/
Then I successfully get a mexa64 file, then I run the m file in matlab, but they tell me that error using mex.
In terminal, I have “FAIL test.cu 2286: cudaMemcpy an illegal memory access was encountered”.
Here is the error parts of that the terminal told.(since this code is too long and confidential, so please excuse me for not showing all the codes)
else{
//printf(“use the nturn = %d \n”, nturn );
jf_gpu_memset(dev_proj, 0, nst*nturn)

		for( register int j = 0; j < 10 ; j++){
			sf2_proj_kernel_3<<<dimGrid3, dimBlock3>>>( 
				j, nx, nz, nt, ns, 
				wt, wz, dwt, dwz, 
				dev_list_num, dev_list, dev_nbins, 
				dev_weight, 
				dev_zinc,
				dev_proj,
				dev_image );	
		}

		//sf2_proj_kernel_4<<<dimGrid4, dimBlock4>>>(nx, nz, nt, ns, wz, wt, ws, ds, dt, dsd, temp_proj, dev_proj, cgeom, pa->o_is_ns_nt);
		//jf_gpu_get(pp ,temp_proj, nproj_cells)
		printf("%p,%p,%p \n",pp,dev_proj,nproj_cells);
		jf_gpu_get(pp ,dev_proj, nproj_cells)
		pp = pp + nproj_cells;
	}

Obviously you entered incorrect parameters into a cudaMemcpy(), as the error message suggests.

There is not enough information in your ‘confidential’ code to make any other suggestion.