Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,10 @@ void eventsChecker::ZEeventsChecker::checkForDeadlock(
// Form the dependency in the DAG
for (uint32_t i = 0; i < numWaitEvents; i++) {
auto it = eventToDagID.find(phWaitEvents[i]);

if (it == eventToDagID.end()) {
std::cerr << "Warning: phWaitEvents {" << phWaitEvents[i] << "} might be an invalid event in call to " << zeCallDisc << std::endl;
return;
}
uint32_t dagID = it->second;
if (dagID == invalidDagID) {
// Create a new node in the DAG for this wait event. That action will be created some time in the future.
Expand Down
8 changes: 6 additions & 2 deletions third_party/xla/ordered_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,16 @@ class OrderedSet {
// set.
void Erase(T value) {
auto it = value_to_index_.find(value);
assert(it != value_to_index_.end());
if (it == value_to_index_.end()) {
std::cerr << "Value not found in OrderedSet" << std::endl;
exit(0);
}

auto index = it->second;
// Since we don't want to move values around in `value_sequence_` we swap
// the value in the last position and with value to be deleted and then
// pop_back.
value_to_index_[value_sequence_.back()] = it->second;
value_to_index_[value_sequence_.back()] = index;
std::swap(value_sequence_[it->second], value_sequence_.back());
value_sequence_.pop_back();
value_to_index_.erase(it);
Expand Down
Loading