Unhandled exception at in : Access violation reading location

Hi, I am trying to rewrite the Lapack function that it will works on the GPU, I get the error Unhandled exception at … in …: Access violation reading location, I might add that when the matrix size is 900 function works well, and already at the size more than 900 I get error.

cudaMalloc((void**)&(zd__), (n+1)(n+1)sizeof(float));
cudaMalloc((void
)&(workd), (2**n)*sizeof(float));

/* Parameter adjustments */
–d__;
–e;
z_dim1 = *ldz;
z_offset = 1 + z_dim1;
z__ -= z_offset;
–work;

cudaMemcpy(workd, work, (2**n-2)*sizeof(float), cudaMemcpyHostToDevice);
cudaMemcpy(&zd__[m * z_dim1 + 1], &z__[m * z_dim1 + 1], (n)(*n)*sizeof(float), cudaMemcpyHostToDevice);
slasr_GPU(“R”, “V”, “F”, n, &mm, &workd[m], &workd[*n - 1 + m], &zd__[m * z_dim1 + 1], ldz);
cudaMemcpy(&z__[m * z_dim1 + 1], &zd__[m * z_dim1 + 1], (n)(*n)*sizeof(float), cudaMemcpyDeviceToHost);

Thank you for your help

Let me add that this function is performed in a loop and is performed several times before I get the error.