 			printf("***rsnew:\n");
 			printf("rsnew = %f \n", rsnew[0]);
 			printf("***shared memory content after 3rd blockReduceSum:\n");
-			for(int i = 0; i < 100; i++)
+			for(int i = 0; i < f; i++)
 				printf("%f ", sharedp[i]);
 			printf("\n");
-			for(int i = 0; i < 100; i++)
+			for(int i = 0; i < f; i++)
 				printf("%f ", sharedr[i]);
 			printf("\n");
-			for(int i = 0; i < 100; i++)
+			for(int i = 0; i < f; i++)
 				printf("%f ", sharedap[i]);
 			printf("\n");
 		}



void updateXWithCGHost(float * A, float * x, float * b, const int batchSize, const int f, const float cgIter){
	updateXWithCGKernel<<<batchSize, f>>>
		(A, x, b, batchSize, f, cgIter);
	cudaDeviceSynchronize();
	cudaCheckError();

		printf("***rsold:\n");
		printf("rsold = %f \n", rsold[0]);
		printf("***shared memory content after 1st blockReduceSum:\n");
		for(int i = 0; i < f; i++)
			printf("%f ", sharedp[i]);
		printf("\n");
		for(int i = 0; i < f; i++)
			printf("%f ", sharedr[i]);
		printf("\n");
		for(int i = 0; i < f; i++)
			printf("%f ", sharedap[i]);
		printf("\n");
	}
