From aace42cfab175c74c1e77452641f3e82f82c5f98 Mon Sep 17 00:00:00 2001 From: Saleel Kudchadker Date: Sat, 16 Apr 2022 16:18:16 -0700 Subject: [PATCH] SWDEV-301667 - Add separate field for event scope Change-Id: I0e6b50d1a34b275ea4f1a4c659430c406d9a5a7e --- hipamd/src/hip_event.cpp | 4 ++-- hipamd/src/hip_event.hpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hipamd/src/hip_event.cpp b/hipamd/src/hip_event.cpp index 54a103de5f..762e98e2f9 100644 --- a/hipamd/src/hip_event.cpp +++ b/hipamd/src/hip_event.cpp @@ -209,7 +209,7 @@ hipError_t Event::streamWait(hipStream_t stream, uint flags) { hipError_t Event::recordCommand(amd::Command*& command, amd::HostQueue* queue, uint32_t ext_flags ) { if (command == nullptr) { - uint32_t releaseFlags = ((ext_flags == 0) ? flags : ext_flags) & + int32_t releaseFlags = ((ext_flags == 0) ? flags : ext_flags) & (hipEventReleaseToSystem | hipEventReleaseToDevice); if (releaseFlags & hipEventReleaseToDevice) { releaseFlags = amd::Device::kCacheStateAgent; @@ -219,7 +219,7 @@ hipError_t Event::recordCommand(amd::Command*& command, amd::HostQueue* queue, releaseFlags = amd::Device::kCacheStateIgnore; } // Always submit a EventMarker. - command = new hip::EventMarker(*queue, !kMarkerDisableFlush, releaseFlags); + command = new hip::EventMarker(*queue, !kMarkerDisableFlush, true, releaseFlags); } return hipSuccess; } diff --git a/hipamd/src/hip_event.hpp b/hipamd/src/hip_event.hpp index 97ba296ad0..8758eb1c3d 100644 --- a/hipamd/src/hip_event.hpp +++ b/hipamd/src/hip_event.hpp @@ -53,12 +53,14 @@ typedef struct ihipIpcEventShmem_s { class EventMarker : public amd::Marker { public: - EventMarker(amd::HostQueue& queue, bool disableFlush, uint32_t markerTs = 0) + EventMarker(amd::HostQueue& queue, bool disableFlush, bool markerTs = false, + int32_t scope = amd::Device::kCacheStateInvalid) : amd::Marker(queue, disableFlush) { profilingInfo_.enabled_ = true; profilingInfo_.callback_ = nullptr; profilingInfo_.marker_ts_ = markerTs; profilingInfo_.clear(); + setEventScope(scope); } };