SWDEV-272496 - Detect callbacks and force AQL barrier

HIP tests require HIP callbacks to be processed in another thread.
This change will use a thread from HSA signal callbacks to make
sure a HIP callback was done asynchronously.
Also process the callback before changing the status of command

Change-Id: Icef85d0e0f808663882cf6881ff1be3e5eca29ac
This commit is contained in:
German Andryeyev
2021-03-03 17:28:58 -05:00
parent c13f9df42a
commit 7f32d0b425
3 changed files with 32 additions and 7 deletions
+9
View File
@@ -2853,9 +2853,18 @@ void VirtualGPU::flush(amd::Command* list, bool wait) {
if (skip_cpu_wait) {
// Search for the last command in the batch to track GPU state
amd::Command* current = list;
// HIP tests expect callbacks processed from another thread, hence force AQL barrier always, so
// HSA signal callback will process HIP callback asynchronously
if (list->Callback() != nullptr) {
hasPendingDispatch_ = true;
}
while (current->getNext() != nullptr) {
current = current->getNext();
if (current->Callback() != nullptr) {
hasPendingDispatch_ = true;
}
}
// Enable profiling, so runtime can track TS
profilingBegin(*current);