 	dim3 dimGridCA(state.cols / dimBlockCA.x, block_CA.rows / dimBlockCA.y);
 
 	dim3 dimBlockA(1, 1);
-	dim3 dimGridA(state.cols / dimBlockA.x, MatrixA_pow.rows / dimBlockA.y);
+	dim3 dimGridA(state.cols / dimBlockA.x, MatrixAp.rows / dimBlockA.y);
 
 
 	for(i = 0; i < samples;) {

	int i, j;
	float* sample;
	Matrix block_CA, block_CA_line, block_samples;
	Matrix MatrixA_pow, MatrixA_powtmp;
	Matrix MatrixCA;
	Matrix statetmp;

	Matrix dMatrixA_pow, dblock_CA, dstate1, dstate2, dstatetmp, dblock_samples;

	cudaSetDevice(0);


			printf("%f, ", sample[i+j]);
#endif
		}
	//	statetmp = m_multiplyblockdiag(MatrixAp,state,2);
		MatrixMultiplyKernel<<<dimGridA, dimBlockA>>>(dMatrixAp, dstate1, dstate2);
		dstatetmp = dstate1;
		dstate1 = dstate2;
		dstate2 = dstatetmp;
