diff options
author | Junyan He <junyan.he@linux.intel.com> | 2015-11-17 07:40:06 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2015-11-17 16:23:17 +0800 |
commit | 47b9cca14be0c69c77b12bc4f467dbcab49b4b15 (patch) | |
tree | d4e53c74b6f72f1dd163cd385d21e06c6c90b27b | |
parent | 1b04e5652da9c739b0867b2b2480e8c7d71f03c1 (diff) |
Backend: Add profiling registers to curbe.
Add five timestamp reigsters and one pointer register
into curbe. The five timestamp reigsters will hold
all the infomation of profiling timestamps, includes
20 uint timestamps for each point, 1 ulong prolog holding
the start time and and 1 ulong epilog holding the
end time of that kernel. The pointer reigster will hold
the log buffer address.
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 | 6 | ||||
-rw-r--r-- | backend/src/ir/profile.cpp | 12 | ||||
-rw-r--r-- | backend/src/ir/profile.hpp | 8 |
3 files changed, 24 insertions, 2 deletions
diff --git a/backend/src/backend/program.h b/backend/src/backend/program.h index 86b31776..14752ad5 100644 --- a/backend/src/backend/program.h +++ b/backend/src/backend/program.h @@ -99,6 +99,12 @@ enum gbe_curbe_type { GBE_CURBE_BLOCK_IP, GBE_CURBE_DW_BLOCK_IP, GBE_CURBE_THREAD_NUM, + 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, GBE_GEN_REG, }; diff --git a/backend/src/ir/profile.cpp b/backend/src/ir/profile.cpp index 44868636..90b039b9 100644 --- a/backend/src/ir/profile.cpp +++ b/backend/src/ir/profile.cpp @@ -43,7 +43,11 @@ namespace ir { "zero", "one", "retVal", "printf_buffer_pointer", "printf_index_buffer_pointer", - "dwblockip" + "dwblockip", + "profiling_buffer_pointer", + "profiling_timestamps0", "profiling_timestamps1", + "profiling_timestamps2", "profiling_timestamps3", + "profiling_timestamps4" }; #if GBE_DEBUG @@ -86,6 +90,12 @@ namespace ir { DECL_NEW_REG(FAMILY_DWORD, printfbptr, 1, GBE_CURBE_PRINTF_BUF_POINTER); DECL_NEW_REG(FAMILY_DWORD, printfiptr, 1, GBE_CURBE_PRINTF_INDEX_POINTER); DECL_NEW_REG(FAMILY_DWORD, dwblockip, 0, GBE_CURBE_DW_BLOCK_IP); + DECL_NEW_REG(FAMILY_DWORD, profilingbptr, 1, GBE_CURBE_PROFILING_BUF_POINTER); + DECL_NEW_REG(FAMILY_DWORD, profilingts0, 0, GBE_CURBE_PROFILING_TIMESTAMP0); + DECL_NEW_REG(FAMILY_DWORD, profilingts1, 0, GBE_CURBE_PROFILING_TIMESTAMP1); + 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); } #undef DECL_NEW_REG diff --git a/backend/src/ir/profile.hpp b/backend/src/ir/profile.hpp index a8445c44..e586f44a 100644 --- a/backend/src/ir/profile.hpp +++ b/backend/src/ir/profile.hpp @@ -71,7 +71,13 @@ namespace ir { static const Register printfbptr = Register(27); // printf buffer address . static const Register printfiptr = Register(28); // printf index buffer address. static const Register dwblockip = Register(29); // blockip - static const uint32_t regNum = 30; // number of special registers + static const Register profilingbptr = Register(30); // buffer addr for profiling. + static const Register profilingts0 = Register(31); // timestamp for profiling. + static const Register profilingts1 = Register(32); // timestamp for profiling. + 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 extern const char *specialRegMean[]; // special register name. } /* namespace ocl */ |