[Beignet] [PATCH 12/19] Backend: Add profiling registers into curbe.

junyan.he at inbox.com junyan.he at inbox.com
Tue Sep 8 17:01:03 PDT 2015


From: Junyan He <junyan.he at linux.intel.com>

Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
 backend/src/backend/gen_context.cpp |   17 +++++++++++++++++
 backend/src/backend/program.h       |    6 ++++++
 2 files changed, 23 insertions(+)

diff --git a/backend/src/backend/gen_context.cpp b/backend/src/backend/gen_context.cpp
index 696d86a..a12d056 100644
--- a/backend/src/backend/gen_context.cpp
+++ b/backend/src/backend/gen_context.cpp
@@ -2348,6 +2348,23 @@ namespace gbe
     allocCurbeReg(zero, GBE_CURBE_ZERO);
     allocCurbeReg(one, GBE_CURBE_ONE);
     allocCurbeReg(btiUtil, GBE_CURBE_BTI_UTIL);
+    if (inProfilingMode) {
+      allocCurbeReg(profilingbptr, GBE_CURBE_PROFILING_BUF_POINTER);
+      allocCurbeReg(profilingts0, GBE_CURBE_PROFILING_TIMESTAMP0);
+      allocCurbeReg(profilingts1, GBE_CURBE_PROFILING_TIMESTAMP1);
+      allocCurbeReg(profilingts2, GBE_CURBE_PROFILING_TIMESTAMP2);
+      if (this->simdWidth == 8) {
+        allocCurbeReg(profilingts3, GBE_CURBE_PROFILING_TIMESTAMP3);
+        allocCurbeReg(profilingts4, GBE_CURBE_PROFILING_TIMESTAMP4);
+      }
+      allocCurbeReg(lsize0, GBE_CURBE_LOCAL_SIZE_X);
+      allocCurbeReg(lsize1, GBE_CURBE_LOCAL_SIZE_Y);
+      allocCurbeReg(lsize2, GBE_CURBE_LOCAL_SIZE_Z);
+      allocCurbeReg(goffset0, GBE_CURBE_GLOBAL_OFFSET_X);
+      allocCurbeReg(goffset1, GBE_CURBE_GLOBAL_OFFSET_Y);
+      allocCurbeReg(goffset2, GBE_CURBE_GLOBAL_OFFSET_Z);
+    }
+
     if (stackUse.size() != 0)
       allocCurbeReg(stackbuffer, GBE_CURBE_EXTRA_ARGUMENT, GBE_STACK_BUFFER);
     // Go over the arguments and find the related patch locations
diff --git a/backend/src/backend/program.h b/backend/src/backend/program.h
index af19732..4402956 100644
--- a/backend/src/backend/program.h
+++ b/backend/src/backend/program.h
@@ -102,6 +102,12 @@ enum gbe_curbe_type {
   GBE_CURBE_ONE,
   GBE_CURBE_SLM_OFFSET,
   GBE_CURBE_BTI_UTIL,
+  GBE_CURBE_PROFILING_BUF_POINTER,
+  GBE_CURBE_PROFILING_TIMESTAMP0,
+  GBE_CURBE_PROFILING_TIMESTAMP1,
+  GBE_CURBE_PROFILING_TIMESTAMP2,
+  GBE_CURBE_PROFILING_TIMESTAMP3,
+  GBE_CURBE_PROFILING_TIMESTAMP4,
 };
 
 /*! Extra arguments use the negative range of sub-values */
-- 
1.7.9.5





More information about the Beignet mailing list