From aad2e9f5147694d8b87a18cce306737d4a5c13f4 Mon Sep 17 00:00:00 2001
From: Gary Frost <frost.gary@gmail.com>
Date: Fri, 24 Feb 2012 22:29:00 +0000
Subject: [PATCH] New profiling mechanism now works with explicit buffer
 transfers.

---
 .../com/amd/aparapi/sample/mandel/Main.java   | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/samples/mandel/src/com/amd/aparapi/sample/mandel/Main.java b/samples/mandel/src/com/amd/aparapi/sample/mandel/Main.java
index 2cd7dda2..f5f66104 100644
--- a/samples/mandel/src/com/amd/aparapi/sample/mandel/Main.java
+++ b/samples/mandel/src/com/amd/aparapi/sample/mandel/Main.java
@@ -227,9 +227,7 @@ public class Main{
       // Set the default scale and offset, execute the kernel and force a repaint of the viewer.
       kernel.setScaleAndOffset(defaultScale, -1f, 0f);
       kernel.execute(range);
-     
-    
-     
+
       System.arraycopy(rgb, 0, imageRgb, 0, rgb.length);
       viewer.repaint();
 
@@ -276,15 +274,14 @@ public class Main{
                // Set the scale and offset, execute the kernel and force a repaint of the viewer.
                kernel.setScaleAndOffset(scale, x, y);
                kernel.execute(range);
-               
-               /**
-             
-               for (ProfileInfo p:kernel.getProfileInfo()){
-                  System.out.print(" "+p.getType()+" "+p.getLabel()+" "+(p.getEnd()-p.getStart())/1000+"us");
+               List<ProfileInfo> profileInfo = kernel.getProfileInfo();
+               if (profileInfo != null) {
+                  for (ProfileInfo p : profileInfo) {
+                     System.out.print(" " + p.getType() + " " + p.getLabel() + " " +(p.getStart()/1000)+" .. " +(p.getEnd()/1000)+ " "+ (p.getEnd() - p.getStart()) / 1000 + "us");
+                  }
+                  System.out.println();
                }
-               System.out.println();
-                **/
-             
+
                System.arraycopy(rgb, 0, imageRgb, 0, rgb.length);
                viewer.repaint();
             }
-- 
GitLab