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)
- [DH] examples/imagenet/main.cpp