[Beignet] [PATCH 08/10 OpenCL-2.0] Add state register into schedule consideration.

junyan.he at inbox.com junyan.he at inbox.com
Wed Apr 22 20:26:33 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_insn_scheduling.cpp |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/backend/src/backend/gen_insn_scheduling.cpp b/backend/src/backend/gen_insn_scheduling.cpp
index f3ed4b0..2d6617e 100644
--- a/backend/src/backend/gen_insn_scheduling.cpp
+++ b/backend/src/backend/gen_insn_scheduling.cpp
@@ -192,8 +192,10 @@ namespace gbe
     static const uint32_t MAX_ACC_REGISTER = 1u;
     /*! Maximum number of *physical* tm registers */
     static const uint32_t MAX_TM_REGISTER = 1u;
+    /*! Maximum number of state registers */
+    static const uint32_t MAX_ST_REGISTER = 2u;
     /*! Maximum number of *physical* arf registers */
-    static const uint32_t MAX_ARF_REGISTER = MAX_FLAG_REGISTER + MAX_ACC_REGISTER + MAX_TM_REGISTER;
+    static const uint32_t MAX_ARF_REGISTER = MAX_FLAG_REGISTER + MAX_ACC_REGISTER + MAX_TM_REGISTER + MAX_ST_REGISTER;
     /*! Stores the last node that wrote to a register / memory ... */
     vector<ScheduleDAGNode*> nodes;
     /*! store nodes each node depends on */
@@ -333,6 +335,9 @@ namespace gbe
           return grfNum + MAX_FLAG_REGISTER + nr;
         } else if (file == GEN_ARF_TM) {
           return grfNum + MAX_FLAG_REGISTER + MAX_ACC_REGISTER;
+        } else if (file == GEN_ARF_STATE) {
+          GBE_ASSERT(nr < MAX_ST_REGISTER);
+          return grfNum + MAX_FLAG_REGISTER + MAX_ACC_REGISTER + MAX_TM_REGISTER + nr;
         } else {
           NOT_SUPPORTED;
           return 0;
@@ -398,7 +403,8 @@ namespace gbe
     // Consider barriers and wait write to memory
     if (insn.opcode == SEL_OP_BARRIER ||
         insn.opcode == SEL_OP_FENCE ||
-        insn.opcode == SEL_OP_WAIT) {
+        insn.opcode == SEL_OP_WAIT ||
+        insn.opcode == SEL_OP_WORKGROUP_OP) {
       const uint32_t local = this->getIndex(0xfe);
       const uint32_t global = this->getIndex(0x00);
       this->nodes[local] = this->nodes[global] = node;
-- 
1.7.9.5





More information about the Beignet mailing list