When shareWithAll memory (e.g., host memory) is allocated, set appId
in hc::AmPointerInfo to -1 to indicate that this memory is not mapped
to any device. Peer checking in ihipStream_t::canSeeMemory is not
necessary if memory is shared with all devices. Thus, it is skipped.
Note that earlier host memory is always mapped to device 0 and HIP
always performs peer checking for all kinds of hipMemcpy. Since the
peer checking process requires context locking, hipMemcpy from/to host
memory always grabs device 0's context lock. Therefore, if there is
another thread holding the context lock of device 0 (e.g.,
hipDeviceSynchronize on device 0), hipMemcpy will have to wait for the
lock until it can actually perform memcpy. This can significantly
deteriorate execution performance.
Signed-off-by: Sarunya Pumma <sarunya.pumma@amd.com>
Logging status of hipCtxSynchronize was missing
Test if hip profiling is active for MARKER_END in ihipPostLaunchKernel
Add MARKER_END after the completion of a kernel launched through
the "grid launch"
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.
- Store context inside the tracker rather than using int deviceID that
was always mapped to primary context
- IsPeerWatcher now based on device IDs rather than specific peers.
aligned.
In hcc_am, a bigger buffer will be allocated for alignment purpose
and _unalignedDevicePointer is added in struct AmPointerInfo for
original allocated address.
Associated change is to optimize event recording so it uses
agent-scope releaes (since it was only using system-scope release
to support non-coherent host mem).
Flags and environment variables exist to obtain previous behavior
if desired. Options are documented in new performance guide.
Env var : HIP_EVENT_SYS_RELEASE
Event allocation flags : hipEventReleaseToDevice, hipEventReleaseToSystem
(remove hipEventDisableSystemRelease)
Update test for new functionality.