 	CUDA_SAFE_CALL(cudaMalloc((void**) &device_MatrixCA.elements, m_size(MatrixCA)));
 	CUDA_SAFE_CALL(cudaMemcpy(device_MatrixCA.elements, MatrixCA.elements, m_size(MatrixCA), cudaMemcpyHostToDevice));
 
-	CUDA_SAFE_CALL(cudaMalloc((void**) &device_output_chunk_read.elements, m_size(output_chunk)));
-	CUDA_SAFE_CALL(cudaMemcpy(device_output_chunk_read.elements, output_chunk.elements, m_size(output_chunk), cudaMemcpyHostToDevice));
-
-	CUDA_SAFE_CALL(cudaMalloc((void**) &device_output_chunk_write.elements, m_size(output_chunk)));
-	CUDA_SAFE_CALL(cudaMemcpy(device_output_chunk_write.elements, output_chunk.elements, m_size(output_chunk), cudaMemcpyHostToDevice));
+	CUDA_SAFE_CALL(cudaMalloc((void**) &device_output_chunk_read.elements, m_size(output_chunk_read)));
+	CUDA_SAFE_CALL(cudaMemcpy(device_output_chunk_read.elements, output_chunk_read.elements, m_size(output_chunk_read), cudaMemcpyHostToDevice));
+
+	CUDA_SAFE_CALL(cudaMalloc((void**) &device_output_chunk_write.elements, m_size(output_chunk_write)));
+	CUDA_SAFE_CALL(cudaMemcpy(device_output_chunk_write.elements, output_chunk_write.elements, m_size(output_chunk_write), cudaMemcpyHostToDevice));
 
 	CUDA_SAFE_CALL(cudaMalloc((void**) &device_state_read.elements, m_size(state)));
 	CUDA_SAFE_CALL(cudaMemcpy(device_state_read.elements, state.elements, m_size(state), cudaMemcpyHostToDevice));

#endif

	MatrixCA = m_new(blocksize, MatrixA.cols);
	output_chunk = m_new(blocksize,1);
	MatrixAp = m_new(MatrixA.rows, MatrixA.cols); // BLOCKDIAGMATRIX
	m_identity(MatrixAp);


void generateSignal() {
	int i, j;
	float* output;
	Matrix MatrixCA, MatrixCA_line;
	Matrix output_chunk_read, output_chunk_write, output_chunk_tmp;
	Matrix MatrixAp, MatrixAp_tmp;


