Skip to content

Commit

Permalink
Merge pull request #778 from CHIP-SPV/level-zero-premature-exit
Browse files Browse the repository at this point in the history
Level-zero-premature-exit
  • Loading branch information
pvelesko authored Feb 21, 2024
2 parents 5213ad6 + d460e14 commit 18b02f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,8 @@ int main() {
} else {
std::cout << "FAILED!" << std::endl;
}

CHECK(hipStreamDestroy(q));
CHECK(hipEventDestroy(start));
CHECK(hipEventDestroy(stop));
}
14 changes: 2 additions & 12 deletions src/backend/Level0/CHIPBackendLevel0.cc
Original file line number Diff line number Diff line change
Expand Up @@ -601,16 +601,6 @@ void CHIPEventMonitorLevel0::checkCallbacks() {
CHIPCallbackDataLevel0 *CbData;
LOCK(EventMonitorMtx); // chipstar::EventMonitor::Stop
{

if (Stop) {
logTrace("checkCallbacks: out of callbacks. Exiting "
"thread");
if (Backend->CallbackQueue.size())
logError("Callback thread exiting while there are still active "
"callbacks in the queue");
pthread_exit(0);
}

LOCK(Backend->CallbackQueueMtx); // Backend::CallbackQueue

if ((Backend->CallbackQueue.size() == 0))
Expand Down Expand Up @@ -680,7 +670,7 @@ void CHIPEventMonitorLevel0::checkEvents() {
} // done collecting events to delete
}

void CHIPEventMonitorLevel0::exitChecks() {
void CHIPEventMonitorLevel0::checkExit() {
LOCK(EventMonitorMtx); // chipstar::EventMonitor::Stop
/**
* In the case that a user doesn't destroy all the
Expand Down Expand Up @@ -736,7 +726,7 @@ void CHIPEventMonitorLevel0::monitor() {
usleep(200);
checkCallbacks();
checkEvents();
exitChecks();
checkExit();
} // endless loop
}
// End EventMonitorLevel0
Expand Down
2 changes: 1 addition & 1 deletion src/backend/Level0/CHIPBackendLevel0.hh
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class CHIPEventMonitorLevel0 : public chipstar::EventMonitor {
* @brief Check if stop was requested for this monitor, if so handle all
* outstanding events
*/
void exitChecks();
void checkExit();

void checkCallbacks();

Expand Down

0 comments on commit 18b02f3

Please sign in to comment.