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


[ROCm/clr commit: f442e975c6]
This commit is contained in:
sunway513 authored and Ben Sander committed 2017-04-06 21:02:50 -05:00
1 parent c2acfe24cc
commit 1897ca4a20
4 files changed
+99 -41

No files matched your search

-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.