Index: Pi/OpenCL/PiOpenCL
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: Pi/OpenCL/PiOpenCL.c
===================================================================
--- Pi/OpenCL/PiOpenCL.c	(revision 152)
+++ Pi/OpenCL/PiOpenCL.c	(revision 153)
@@ -275,41 +275,41 @@
 
       uint64_t HostInside[ParallelRate];
 
-      // Set start timer
-      gettimeofday(&tv1, &tz);
-      printf("Loops: ");
       for (uint32_t loop=0;loop<Loops;loop++) {
-	// Execute the OpenCL kernel with datas
+	// Set start timer
+	gettimeofday(&tv1, &tz);
+	
+    	// Execute the OpenCL kernel with datas
 	clEnqueueNDRangeKernel(cqCommandQueue, OpenCLMainLoopGlobal, 1, NULL,
 			       WorkSize, NULL, 0, NULL, NULL);
-      
+	// Copy each result for each PR from Device to Host
 	clEnqueueReadBuffer(cqCommandQueue, GPUInside, CL_TRUE, 0,
 			    ParallelRate * sizeof(uint64_t), HostInside, 0, NULL, NULL);
-	printf("%i ",loop);
+	uint64_t inside=0;
+
+	for (int i= 0; i < ParallelRate; i++) {
+	  inside+=HostInside[i];
+	}
+	  
+	// Set stop timer
+	gettimeofday(&tv2, &tz);
+
+	double elapsed=(double)((tv2.tv_sec-tv1.tv_sec) * 1000000L +
+				(tv2.tv_usec-tv1.tv_usec))/1000000;  
+
+	double itops=(double)(ParallelRate*IterationsEach)/elapsed;
+      
+	printf("Inside/Total %ld %ld\nParallelRate %i\nElapsed Time %.2f\nItops %.0f\nPi estimation %f\n\n",inside,ParallelRate*IterationsEach,ParallelRate,elapsed,itops,(4.*(float)inside/((float)(ParallelRate)*(float)(IterationsEach))));
       }
       printf("\n\n");
       
-      // Set stop timer
-      gettimeofday(&tv2, &tz);
-
       clReleaseKernel(OpenCLMainLoopGlobal);
       clReleaseProgram(OpenCLProgram);
       clReleaseCommandQueue(cqCommandQueue);
       clReleaseContext(GPUContext);
       clReleaseMemObject(GPUInside);
 
-      uint64_t inside=0;
-      for (int i= 0; i < ParallelRate; i++) {
-	inside+=HostInside[i];
-      }
-
-      double elapsed=(double)((tv2.tv_sec-tv1.tv_sec) * 1000000L +
-			      (tv2.tv_usec-tv1.tv_usec))/1000000./(double)Loops;  
-
-      double itops=(double)(ParallelRate*IterationsEach)/elapsed;
       
-      printf("Inside/Total %ld %ld\nParallelRate %i\nElapsed Time %.2f\nItops %.0f\nPi estimation %f\n\n",inside,ParallelRate*IterationsEach,ParallelRate,elapsed,itops,(4.*(float)inside/((float)(ParallelRate)*(float)(IterationsEach))));
-      
       return 0;
     }
 }
