 		
 		if(test_view_matrix){
 			/* get array of values */
-			TRY( VecGetArray(y.get_vector(), &values) );
+			#ifndef USE_GPU
+				TRY( VecGetArray(y.get_vector(), &values) );
+			#else
+				TRY( VecCUDAGetArrayReadWrite(y.get_vector(), &values) );
+			#endif
 		
 			/* print row */
 			TRY( PetscPrintf(PETSC_COMM_WORLD, "%*d: ", 3, row_idx) );

		TRY( VecAssemblyBegin(x_Vec) );
		TRY( VecAssemblyEnd(x_Vec) );

		TRY( VecGetArray(x_Vec,&gamma_arr) );
		if(t >= Tbegin && t < Tend){
			tlocal = t - Tbegin;
			gamma_arr[tlocal + k*Tlocal] = 1;
		}
		TRY( VecRestoreArray(x_Vec,&gamma_arr) );
		TRY( VecAssemblyBegin(x_Vec) );
		TRY( VecAssemblyEnd(x_Vec) );


			TRY( PetscPrintf(PETSC_COMM_WORLD, "\n") );

			/* restore array with values */
			#ifndef USE_GPU
				TRY( VecRestoreArray(y.get_vector(), &values) );
			#else
				TRY( VecCUDARestoreArrayReadWrite(y.get_vector(), &values) );
			#endif

		}
	}

