author | Ajay Jayaraj <ajayj@ti.com> | |
Mon, 15 Oct 2018 16:00:46 +0000 (11:00 -0500) | ||
committer | Ajay Jayaraj <ajayj@ti.com> | |
Fri, 19 Oct 2018 21:46:52 +0000 (16:46 -0500) | ||
commit | b02178b622d19a6fc6d2cfecc52d36ac2fbd958e | |
tree | e679653df19c654c41ef23b23757dc044b96dcd3 | tree | snapshot (tar.xz tar.gz zip) |
parent | f4aea3acecbc3fda639eb725bd16ec7f1cb73a99 | commit | diff |
Simplify API for multiple contexts
1. Simplify context API in ExecutionObject. Replace context_id variants to
multiple existing APIs with these two APIs:
bool AcquireAndRunContext(uint32_t& context_idx,
int frame_idx,
const IODeviceArgInfo& in,
const IODeviceArgInfo& out);
bool WaitAndReleaseContext(uint32_t context_idx);
2. The timing methods for host execution in EOPs and EOs:
* GetProcessTimeInMilliSeconds()
* GetHostProcessTimeInMilliSeconds()
are no longer accurate with multiple contexts and pipelining.
Replace these methods and replace with a generic timestamp
based approach. There is a single API call to enable time stamps in an
application:
//! Enable time stamp generation for TIDL API events
bool EnableTimeStamps(const std::string& file = "timestamp.log", size_t
num_frames=32);
If this method is called before TIDL API frame processing, the API will
generate timestamps for events corresponding to each frame (e.g.
EOP::ProcessFrameStartAsync, EOP::ProcessFrameWait, etc.). These
timestamps are then written to file when the user's application
completes.
A separate script is used for post-processing the time stamps and
generating data for the user.
(MCT-1073, MCT-1074)
1. Simplify context API in ExecutionObject. Replace context_id variants to
multiple existing APIs with these two APIs:
bool AcquireAndRunContext(uint32_t& context_idx,
int frame_idx,
const IODeviceArgInfo& in,
const IODeviceArgInfo& out);
bool WaitAndReleaseContext(uint32_t context_idx);
2. The timing methods for host execution in EOPs and EOs:
* GetProcessTimeInMilliSeconds()
* GetHostProcessTimeInMilliSeconds()
are no longer accurate with multiple contexts and pipelining.
Replace these methods and replace with a generic timestamp
based approach. There is a single API call to enable time stamps in an
application:
//! Enable time stamp generation for TIDL API events
bool EnableTimeStamps(const std::string& file = "timestamp.log", size_t
num_frames=32);
If this method is called before TIDL API frame processing, the API will
generate timestamps for events corresponding to each frame (e.g.
EOP::ProcessFrameStartAsync, EOP::ProcessFrameWait, etc.). These
timestamps are then written to file when the user's application
completes.
A separate script is used for post-processing the time stamps and
generating data for the user.
(MCT-1073, MCT-1074)
17 files changed: