Support re-recording of same event by different threads.
- Add criticalData structure to hipEvent_t, similar to mechanism used
for streams, contexts, device. Events are always locked
after streams to avoid deadlock.
- ihipEvent_t::locked_copyCrit can be used to copy critical state
including marker. The critical state in the event can then
be re-recorded.
- refactor hipEventElapsedTime. Remmove stale debug code, native signal
refs.
This eliminates host-synchronization for null stream. Instead, the
null-stream uses GPU-side events to wait for other streams.
Default is OFF pending additional testing.
Add enhanced null-stream test.
Also refine HIP_TRACE_API.
1. hipHccModuleLaunchKernel is same as hipModuleLaunchKernel with OpenCL workitem model
2. Added copy right
3. Fixed header naming
Change-Id: I6a7c35a3566e2f8d3f5056613e34193775d4b236
Includes some tricky manipulation of the locks for contexts and streams.
issue is that stealing a stream requires we lock the context to
walk the streams to find a victim. To avoid deadlock, we can't
have a stream locked when we lock the context. This implementation
releases the stream lock, then acquires the context and selects the
victim.
A more stable implemenation might be to copy the stream list
from a context so that a lock is not required to walk all streams.
Smart shared_ptr could be used to prevent the streams from being
deallocated during the walk.
Add passed to hipStreamWaitEvent test.
Fix pointerAttrib test to work with new and old HCC versions.
Minor code touchup.
Change-Id: I139ba6ce9f6bf2b4bee89aebdec5981b4346ffc0
- move _av into stream critical section. ( HCC accelerator_view is not
thread-safe but HIP steram is. )
- Refactored many places in code that need to acquire critical section.
some were previously thread races, ie enqueueing marker.
-remove support for GRID_LAUNCH_VERSION < 20
-Enable USE_AV_COPY based on HCC work-week.
- Review hipModule docs, some calrity/editing.
Change-Id: I3ce7c25ece048c3504f55ecd4683e506bb1fc8b6
Change ihipDevice_t -> ihipCtx_t (new)
Change ihipGetTlsDefaultDevice->ihipGetTlsDefaultCtx
Some other changes from device->ctx where appropriate.
Change-Id: I5c4ae93b2fd42c6303aa23d748eb166b7431925d
- Remove "call-to-call" for hipStreamCreate and hipEventCreate.
These now call an internal functions rather than calling through
hipStreamCreateWithFalgs and hipEventCreateWithFlags.
- Add HIP_INIT_API for more functions so they trace correctly.
- Use stream#DEVICE.STREAMID in debug messages via new specialization in
tace_helper.
Move critical data into separate class and protect with LockAccessor
wrapper class.
For device, the streams list is the critical data since it is modified when
streams are created or destroyed. The streams list is accessed in
several places including when synchronizing across all streams on the
device (ie from the default stream).
Other device data is set once by the device cosntructor and is not critical
so
All functions which acquire the LockAccessor now named with "locked_" prefix.