 	m_print(state);
 #endif
 
+#if MODE == 1
+	cudaSetDevice(0);
+
 	CUDA_SAFE_CALL(cudaMalloc((void**) &device_MatrixAp.elements, m_size(MatrixAp)));
 	CUDA_SAFE_CALL(cudaMemcpy(device_MatrixAp.elements, MatrixAp.elements, m_size(MatrixAp), cudaMemcpyHostToDevice));
 

	float* output;
	Matrix MatrixCA, MatrixCA_line, output_chunk;
	Matrix MatrixAp, tmp_MatrixAp;
	Matrix tmp_state;

	Matrix device_MatrixAp, device_MatrixCA, device_state1, device_state2, device_tmp_state, device_output_chunk;

	cudaSetDevice(0);

#if DEBUG == 2
	printf("MatrixA");

		device_tmp_state = device_state1;
		device_state1 = device_state2;
		device_state2 = device_tmp_state;
#else
		/*
	       	 * CPU IMPLEMENTATION
		 */
		output_chunk = m_multiply(MatrixCA,state);

		for(j = 0; j < blocksize; j++) {
			output[i+j] = m_get(output_chunk,j,0)/128;
		}
		tmp_state = m_multiplyblockdiag(MatrixAp,state,2);
		m_free(state);
		state = tmp_state;
#endif

		i = i + blocksize;
