Refactor events and add initial event option for hipHccModuleLaunchKernel

- Change hipEvent_t to a class.
- Move event logic inside the class.
- Add _type to support Independent, StartCommand, StopCommand events.
  StartCommand returns start timestamp from events.

Change-Id: I4ddd694f2645a3ff7170c9111dc1d3e39931ca21
This commit is contained in:
sunway513
2017-04-06 23:55:15 +00:00
committed by Ben Sander
parent 5995965558
commit cfa3155082
4 changed files with 99 additions and 41 deletions
-17
View File
@@ -1641,23 +1641,6 @@ const char *ihipErrorString(hipError_t hip_error)
};
void ihipSetTs(hipEvent_t e)
{
ihipEvent_t *eh = e;
if (eh->_state == hipEventStatusRecorded) {
// already recorded, done:
return;
} else {
// TODO - use completion-future functions to obtain ticks and timestamps:
hsa_signal_t *sig = static_cast<hsa_signal_t*> (eh->_marker.get_native_handle());
if (sig) {
if (hsa_signal_load_acquire(*sig) == 0) {
eh->_timestamp = eh->_marker.get_end_tick();
eh->_state = hipEventStatusRecorded;
}
}
}
}
// Returns true if copyEngineCtx can see the memory allocated on dstCtx and srcCtx.