diff options
author | Junyan He <junyan.he@linux.intel.com> | 2015-12-01 16:10:30 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2015-12-14 15:11:24 +0800 |
commit | fbb2c48d11f6c898cca80781e879829c2ae8c56f (patch) | |
tree | c5b5084309c40ff2c41fc3ab2ae9f3d622bce5b1 | |
parent | 6a9f7bd276285d1ceaffb2abc3963c006313c317 (diff) |
Backend: Add threadid as a curbe register.
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@linux.intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r-- | backend/src/backend/program.h | 1 | ||||
-rw-r--r-- | backend/src/ir/instruction.cpp | 2 | ||||
-rw-r--r-- | backend/src/ir/profile.cpp | 4 | ||||
-rw-r--r-- | 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 51797ee4..8b493153 100644 --- a/backend/src/backend/program.h +++ b/backend/src/backend/program.h @@ -110,6 +110,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 c0695239..85db579e 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 75e669d4..4e0fc089 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 e586f44a..cc347204 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 */ |