 	output = (float *) malloc(sizeof(float) * samples);
 	blocksize = 100;
 
+#if MODE == 1
+	Matrix device_MatrixAp, device_MatrixCA, device_state1, device_state2, device_tmp_state, device_output_chunk;
+
 	device_MatrixCA = m_new(blocksize, MatrixA.cols);
 	device_output_chunk = m_new(blocksize,1);
 	device_MatrixAp = m_new(MatrixA.rows, MatrixA.cols); // BLOCKDIAGMATRIX
 	device_state1 = m_new(2 * filters, 1);
 	device_state2 = m_new(2 * filters, 1);
+#endif
 
 	MatrixCA = m_new(blocksize, MatrixA.cols);
 	output_chunk = m_new(blocksize,1);

	m_print(state);
#endif

	CUDA_SAFE_CALL(cudaMalloc((void**) &device_MatrixAp.elements, m_size(MatrixAp)));
	CUDA_SAFE_CALL(cudaMemcpy(device_MatrixAp.elements, MatrixAp.elements, m_size(MatrixAp), cudaMemcpyHostToDevice));


		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;
