Skip to content

Commit

Permalink
callbacks create a new event for setting lastEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
pvelesko committed Sep 4, 2024
1 parent 1b38713 commit 6a2266c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/CHIPBackend.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2352,7 +2352,9 @@ public:
const std::vector<std::shared_ptr<chipstar::Event>> &EventsToWaitFor) = 0;
virtual std::shared_ptr<chipstar::Event> enqueueBarrier(
const std::vector<std::shared_ptr<chipstar::Event>> &EventsToWaitFor);

virtual std::shared_ptr<chipstar::Event> enqueueBarrier() {

Check warning on line 2355 in src/CHIPBackend.hh

View workflow job for this annotation

GitHub Actions / cpp-linter

src/CHIPBackend.hh:2355:44 [modernize-use-trailing-return-type]

use a trailing return type for this function
return enqueueBarrier({});
}
virtual std::shared_ptr<chipstar::Event> enqueueMarkerImpl() = 0;

Check warning on line 2358 in src/CHIPBackend.hh

View workflow job for this annotation

GitHub Actions / cpp-linter

src/CHIPBackend.hh:2358:44 [modernize-use-trailing-return-type]

use a trailing return type for this function
std::shared_ptr<chipstar::Event> enqueueMarker();

Expand Down
11 changes: 10 additions & 1 deletion src/backend/Level0/CHIPBackendLevel0.cc
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,16 @@ CHIPCallbackDataLevel0::CHIPCallbackDataLevel0(hipStreamCallback_t CallbackF,
&CpuCallbackCompleteLz->get());
CHIPERR_CHECK_LOG_AND_THROW_TABLE(zeCommandListAppendBarrier);

ChipQueueLz->executeCommandList(CommandList, GpuAck);
// Need to create another event as GpuAck will be destroyed once callback is
// complete
auto CallbackComplete = BackendLz->createEventShared(ChipContextLz);
CallbackComplete->Msg = "CallbackComplete";
auto CallbackCompleteLz =
std::static_pointer_cast<CHIPEventLevel0>(CallbackComplete);
zeStatus = zeCommandListAppendBarrier(CommandList->getCmdList(),
CallbackCompleteLz->get(), 0, nullptr);
CHIPERR_CHECK_LOG_AND_THROW_TABLE(zeCommandListAppendBarrier);
ChipQueueLz->executeCommandList(CommandList, CallbackComplete);
}

// End CHIPCallbackDataLevel0
Expand Down

0 comments on commit 6a2266c

Please sign in to comment.