SWDEV-514686 - Fixed hipEventSynchronize/hipStreamWaitEvent for IPC events
Resolved an issue where hipEventSynchronize and hipStreamWaitEvent APIs did not function correctly for events created with the hipEventInterprocess flag. The bug caused the event to be incorrectly marked as "recorded," leading to these APIs failing to wait for the event as expected. Change-Id: Ic9fdfaab2393beb93d6e0b83661545e902a63499
Este commit está contenido en:
@@ -105,7 +105,7 @@ class Event {
|
||||
constexpr static bool kBatchFlush = true; //!< Flushes CPU command batch in direct dispatch mode
|
||||
|
||||
Event(uint32_t flags) : flags_(flags), lock_(true) /* hipEvent_t lock*/,
|
||||
event_(nullptr), unrecorded_(false), stream_(nullptr) {
|
||||
event_(nullptr), stream_(nullptr) {
|
||||
device_id_ = hip::getCurrentDevice()->deviceId(); // Created in current device ctx
|
||||
}
|
||||
|
||||
@@ -126,21 +126,19 @@ class Event {
|
||||
|
||||
virtual hipError_t recordCommand(amd::Command*& command, amd::HostQueue* stream,
|
||||
uint32_t flags = 0, bool batch_flush = true);
|
||||
virtual hipError_t enqueueRecordCommand(hipStream_t stream, amd::Command* command, bool record);
|
||||
virtual hipError_t enqueueRecordCommand(hipStream_t stream, amd::Command* command);
|
||||
hipError_t addMarker(hipStream_t stream, amd::Command* command,
|
||||
bool record, bool batch_flush = true);
|
||||
bool batch_flush = true);
|
||||
|
||||
void BindCommand(amd::Command& command, bool record) {
|
||||
void BindCommand(amd::Command& command) {
|
||||
amd::ScopedLock lock(lock_);
|
||||
if (event_ != nullptr) {
|
||||
event_->release();
|
||||
}
|
||||
event_ = &command.event();
|
||||
unrecorded_ = !record;
|
||||
command.retain();
|
||||
}
|
||||
|
||||
bool isUnRecorded() const { return unrecorded_; }
|
||||
amd::Monitor& lock() { return lock_; }
|
||||
const int deviceId() const { return device_id_; }
|
||||
void setDeviceId(int id) { device_id_ = id; }
|
||||
@@ -170,10 +168,6 @@ class Event {
|
||||
hip::Stream* stream_;
|
||||
amd::Event* event_;
|
||||
int device_id_;
|
||||
//! Flag to indicate hipEventRecord has not been called. This is needed for
|
||||
//! hip*ModuleLaunchKernel API which takes start and stop events so no
|
||||
//! hipEventRecord is called. Cleanup needed once those APIs are deprecated.
|
||||
bool unrecorded_;
|
||||
};
|
||||
|
||||
class EventDD : public Event {
|
||||
@@ -222,7 +216,7 @@ class IPCEvent : public Event {
|
||||
|
||||
hipError_t recordCommand(amd::Command*& command, amd::HostQueue* queue,
|
||||
uint32_t flags = 0, bool batch_flush = true) override;
|
||||
hipError_t enqueueRecordCommand(hipStream_t stream, amd::Command* command, bool record);
|
||||
hipError_t enqueueRecordCommand(hipStream_t stream, amd::Command* command);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Referencia en una nueva incidencia
Block a user