SWDEV-478708 - Remove forced wait of 10us in hipEventQuery
Change-Id: I868aae14311c3cdfc09aa03252ac324c4b79b864
[ROCm/clr commit: ade1954015]
Cette révision appartient à :
@@ -31,21 +31,21 @@ namespace hip {
|
||||
static amd::Monitor eventSetLock{};
|
||||
static std::unordered_set<hipEvent_t> eventSet;
|
||||
|
||||
bool Event::ready(eventType type) {
|
||||
bool Event::ready() {
|
||||
if (event_->status() != CL_COMPLETE) {
|
||||
event_->notifyCmdQueue();
|
||||
}
|
||||
// Check HW status of the ROCcrl event. Note: not all ROCclr modes support HW status
|
||||
bool ready = CheckHwEvent(type);
|
||||
bool ready = CheckHwEvent();
|
||||
if (!ready) {
|
||||
ready = (event_->status() == CL_COMPLETE);
|
||||
}
|
||||
return ready;
|
||||
}
|
||||
|
||||
bool EventDD::ready(eventType type) {
|
||||
bool EventDD::ready() {
|
||||
// Check HW status of the ROCcrl event. Note: not all ROCclr modes support HW status
|
||||
bool ready = CheckHwEvent(type);
|
||||
bool ready = CheckHwEvent();
|
||||
// FIXME: Remove status check entirely
|
||||
if (!ready) {
|
||||
ready = (event_->status() == CL_COMPLETE);
|
||||
@@ -61,7 +61,7 @@ hipError_t Event::query() {
|
||||
return hipSuccess;
|
||||
}
|
||||
|
||||
return ready(Query) ? hipSuccess : hipErrorNotReady;
|
||||
return ready() ? hipSuccess : hipErrorNotReady;
|
||||
}
|
||||
|
||||
hipError_t Event::synchronize() {
|
||||
@@ -109,7 +109,7 @@ hipError_t Event::elapsedTime(Event& eStop, float& ms) {
|
||||
return hipErrorInvalidHandle;
|
||||
}
|
||||
|
||||
if (!ready(ElapsedTime)) {
|
||||
if (!ready()) {
|
||||
return hipErrorNotReady;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ hipError_t Event::elapsedTime(Event& eStop, float& ms) {
|
||||
return hipErrorInvalidHandle;
|
||||
}
|
||||
|
||||
if (!ready(ElapsedTime) || !eStop.ready(ElapsedTime)) {
|
||||
if (!ready() || !eStop.ready()) {
|
||||
return hipErrorNotReady;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ hipError_t Event::streamWait(hipStream_t stream, uint flags) {
|
||||
hip::Stream* hip_stream = hip::getStream(stream);
|
||||
// Access to event_ object must be lock protected
|
||||
amd::ScopedLock lock(lock_);
|
||||
if ((event_ == nullptr) || (event_->command().queue() == hip_stream) || ready(StreamWait)) {
|
||||
if ((event_ == nullptr) || (event_->command().queue() == hip_stream) || ready()) {
|
||||
return hipSuccess;
|
||||
}
|
||||
if (!event_->notifyCmdQueue()) {
|
||||
|
||||
@@ -90,21 +90,14 @@ class EventMarker : public amd::Marker {
|
||||
}
|
||||
};
|
||||
|
||||
enum eventType { Query, StreamWait, ElapsedTime };
|
||||
class Event {
|
||||
/// capture stream where event is recorded
|
||||
hipStream_t captureStream_ = nullptr;
|
||||
/// Previous captured nodes before event record
|
||||
std::vector<hip::GraphNode*> nodesPrevToRecorded_;
|
||||
protected:
|
||||
bool CheckHwEvent(eventType type) {
|
||||
bool ready;
|
||||
if (type == Query) {
|
||||
ready = g_devices[deviceId()]->devices()[0]->IsHwEventReadyForcedWait(*event_);
|
||||
} else {
|
||||
ready = g_devices[deviceId()]->devices()[0]->IsHwEventReady(*event_, false, flags_);
|
||||
}
|
||||
return ready;
|
||||
bool CheckHwEvent() {
|
||||
return g_devices[deviceId()]->devices()[0]->IsHwEventReady(*event_, false, flags_);
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -166,7 +159,7 @@ class Event {
|
||||
return hipErrorInvalidConfiguration;
|
||||
}
|
||||
virtual bool awaitEventCompletion();
|
||||
virtual bool ready(eventType type);
|
||||
virtual bool ready();
|
||||
virtual int64_t time(bool getStartTs) const;
|
||||
|
||||
protected:
|
||||
@@ -186,7 +179,7 @@ class EventDD : public Event {
|
||||
virtual ~EventDD() {}
|
||||
|
||||
virtual bool awaitEventCompletion();
|
||||
virtual bool ready(eventType type);
|
||||
virtual bool ready();
|
||||
virtual int64_t time(bool getStartTs) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ hipError_t hipFreeAsync(void* dev_ptr, hipStream_t stream) {
|
||||
event = nullptr;
|
||||
} else {
|
||||
// Make sure runtime sends a notification to the worker thread
|
||||
auto result = event->ready(Query);
|
||||
auto result = event->ready();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ bool MemoryPool::FreeMemory(amd::Memory* memory, Stream* stream, Event* event) {
|
||||
if (hipSuccess == e->addMarker(reinterpret_cast<hipStream_t>(stream), nullptr, true)) {
|
||||
ts.SetEvent(e);
|
||||
// Make sure runtime sends a notification
|
||||
auto result = e->ready(Query);
|
||||
auto result = e->ready();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur