[Beignet] [PATCH 03/13] Backend: Add threadid as a curbe register.
junyan.he at inbox.com
junyan.he at inbox.com
Tue Dec 1 00:10:30 PST 2015
From: Junyan He <junyan.he at linux.intel.com>
We need to build a map between logical workgroup thread and
real hw thread. This curbe will hold the logical workgroup thread
ID when it is executed on some HW thread.
Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
backend/src/backend/program.h | 1 +
backend/src/ir/instruction.cpp | 2 +-
backend/src/ir/profile.cpp | 4 +++-
backend/src/ir/profile.hpp | 3 ++-
4 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/backend/src/backend/program.h b/backend/src/backend/program.h
index f948a6b..fd8fd6e 100644
--- a/backend/src/backend/program.h
+++ b/backend/src/backend/program.h
@@ -105,6 +105,7 @@ enum gbe_curbe_type {
GBE_CURBE_PROFILING_TIMESTAMP2,
GBE_CURBE_PROFILING_TIMESTAMP3,
GBE_CURBE_PROFILING_TIMESTAMP4,
+ GBE_CURBE_THREAD_ID,
GBE_GEN_REG,
};
diff --git a/backend/src/ir/instruction.cpp b/backend/src/ir/instruction.cpp
index 734e66b..9d6483c 100644
--- a/backend/src/ir/instruction.cpp
+++ b/backend/src/ir/instruction.cpp
@@ -1447,7 +1447,7 @@ namespace ir {
case WORKGROUP_OP_EXCLUSIVE_ADD:
case WORKGROUP_OP_EXCLUSIVE_MIN:
case WORKGROUP_OP_EXCLUSIVE_MAX:
- if (this->srcNum != 1) {
+ if (this->srcNum != 3) {
whyNot = "Wrong number of source.";
return false;
}
diff --git a/backend/src/ir/profile.cpp b/backend/src/ir/profile.cpp
index 75e669d..4e0fc08 100644
--- a/backend/src/ir/profile.cpp
+++ b/backend/src/ir/profile.cpp
@@ -47,7 +47,8 @@ namespace ir {
"profiling_buffer_pointer",
"profiling_timestamps0", "profiling_timestamps1",
"profiling_timestamps2", "profiling_timestamps3",
- "profiling_timestamps4"
+ "profiling_timestamps4",
+ "threadid"
};
#if GBE_DEBUG
@@ -96,6 +97,7 @@ namespace ir {
DECL_NEW_REG(FAMILY_DWORD, profilingts2, 0, GBE_CURBE_PROFILING_TIMESTAMP2);
DECL_NEW_REG(FAMILY_DWORD, profilingts3, 0, GBE_CURBE_PROFILING_TIMESTAMP3);
DECL_NEW_REG(FAMILY_DWORD, profilingts4, 0, GBE_CURBE_PROFILING_TIMESTAMP4);
+ DECL_NEW_REG(FAMILY_DWORD, threadid, 1, GBE_CURBE_THREAD_ID);
}
#undef DECL_NEW_REG
diff --git a/backend/src/ir/profile.hpp b/backend/src/ir/profile.hpp
index e586f44..cc34720 100644
--- a/backend/src/ir/profile.hpp
+++ b/backend/src/ir/profile.hpp
@@ -77,7 +77,8 @@ namespace ir {
static const Register profilingts2 = Register(33); // timestamp for profiling.
static const Register profilingts3 = Register(34); // timestamp for profiling.
static const Register profilingts4 = Register(35); // timestamp for profiling.
- static const uint32_t regNum = 36; // number of special registers
+ static const Register threadid = Register(36); // the thread id of this thread.
+ static const uint32_t regNum = 37; // number of special registers
extern const char *specialRegMean[]; // special register name.
} /* namespace ocl */
--
1.7.9.5
More information about the Beignet
mailing list