[Beignet] [PATCH 3/8] OCL20: add ir register enqueuebufptr for enqueue global buffer.

Yang Rong rong.r.yang at intel.com
Fri May 20 07:46:02 UTC 2016


Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
 backend/src/backend/program.h | 7 +++++++
 backend/src/ir/profile.cpp    | 3 ++-
 backend/src/ir/profile.hpp    | 3 ++-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/backend/src/backend/program.h b/backend/src/backend/program.h
index a3f9be8..5bda860 100644
--- a/backend/src/backend/program.h
+++ b/backend/src/backend/program.h
@@ -105,6 +105,7 @@ enum gbe_curbe_type {
   GBE_CURBE_THREAD_ID,
   GBE_CURBE_CONSTANT_ADDRSPACE,
   GBE_CURBE_STACK_SIZE,
+  GBE_CURBE_ENQUEUE_BUF_POINTER,
   GBE_GEN_REG,
 };
 
@@ -278,6 +279,9 @@ extern gbe_program_get_kernel_by_name_cb *gbe_program_get_kernel_by_name;
 typedef gbe_kernel (gbe_program_get_kernel_cb)(gbe_program, uint32_t ID);
 extern gbe_program_get_kernel_cb *gbe_program_get_kernel;
 
+typedef const char* (gbe_program_get_device_enqueue_kernel_name_cb)(gbe_program, uint32_t ID);
+extern gbe_program_get_device_enqueue_kernel_name_cb *gbe_program_get_device_enqueue_kernel_name;
+
 /*! Get the kernel name */
 typedef const char *(gbe_kernel_get_name_cb)(gbe_kernel);
 extern gbe_kernel_get_name_cb *gbe_kernel_get_name;
@@ -351,6 +355,9 @@ extern gbe_kernel_use_slm_cb *gbe_kernel_use_slm;
 typedef int32_t (gbe_kernel_get_slm_size_cb)(gbe_kernel);
 extern gbe_kernel_get_slm_size_cb *gbe_kernel_get_slm_size;
 
+typedef uint32_t (gbe_kernel_use_device_enqueue_cb)(gbe_kernel);
+extern gbe_kernel_use_device_enqueue_cb *gbe_kernel_use_device_enqueue;
+
 /*mutex to lock global llvmcontext access.*/
 extern void acquireLLVMContextLock();
 extern void releaseLLVMContextLock();
diff --git a/backend/src/ir/profile.cpp b/backend/src/ir/profile.cpp
index 3d60f0e..3d51f56 100644
--- a/backend/src/ir/profile.cpp
+++ b/backend/src/ir/profile.cpp
@@ -46,7 +46,7 @@ namespace ir {
         "dwblockip",
         "threadid",
         "constant_addrspace_start",
-        "stack_size"
+        "stack_size", "enqueue_buffer_pointer",
     };
 
 #if GBE_DEBUG
@@ -93,6 +93,7 @@ namespace ir {
       DECL_NEW_REG(FAMILY_DWORD, threadid, 1, GBE_CURBE_THREAD_ID);
       DECL_NEW_REG(FAMILY_QWORD, constant_addrspace, 1, GBE_CURBE_CONSTANT_ADDRSPACE);
       DECL_NEW_REG(FAMILY_QWORD, stacksize, 1, GBE_CURBE_STACK_SIZE);
+      DECL_NEW_REG(FAMILY_QWORD, enqueuebufptr, 1, GBE_CURBE_ENQUEUE_BUF_POINTER);
     }
 #undef DECL_NEW_REG
 
diff --git a/backend/src/ir/profile.hpp b/backend/src/ir/profile.hpp
index a1b67bc..e295ef4 100644
--- a/backend/src/ir/profile.hpp
+++ b/backend/src/ir/profile.hpp
@@ -75,7 +75,8 @@ namespace ir {
     static const Register threadid = Register(31); // the thread id of this thread.
     static const Register constant_addrspace = Register(32);  // starting address of program-scope constant
     static const Register stacksize = Register(33); // stack buffer total size
-    static const uint32_t regNum = 34;             // number of special registers
+    static const Register enqueuebufptr = Register(34); // enqueue buffer address .
+    static const uint32_t regNum = 35;             // number of special registers
     extern const char *specialRegMean[];           // special register name.
   } /* namespace ocl */
 
-- 
1.9.1



More information about the Beignet mailing list