SWDEV-313306 - Fix Co-operative groups dtests

Add a state indicator to retain ExternalSignals when needed.
Co-operative group launch uses external signals to indicate a dependency
to the next command.

Change-Id: I6d0daa006e2377c3bbf4aeca0fd5b63c7ac8fbbb
Este commit está contenido en:
Saleel Kudchadker
2021-12-17 12:41:33 -08:00
padre e5122e3bc7
commit 1fbd75b825
Se han modificado 2 ficheros con 15 adiciones y 8 borrados
+8 -2
Ver fichero
@@ -1008,6 +1008,7 @@ bool VirtualGPU::releaseGpuMemoryFence(bool skip_cpu_wait) {
// Dispatch barrier packet into the queue
dispatchBarrierPacket(kBarrierPacketHeader);
hasPendingDispatch_ = false;
retainExternalSignals_ = false;
}
// Check if runtime could skip CPU wait
@@ -1277,7 +1278,9 @@ void VirtualGPU::profilingBegin(amd::Command& command, bool drmProfiling) {
}
if (AMD_DIRECT_DISPATCH) {
Barriers().ClearExternalSignals();
if (!retainExternalSignals_) {
Barriers().ClearExternalSignals();
}
for (auto it = command.eventWaitList().begin(); it < command.eventWaitList().end(); ++it) {
void* hw_event = ((*it)->NotifyEvent() != nullptr) ?
(*it)->NotifyEvent()->HwEvent() : (*it)->HwEvent();
@@ -1304,10 +1307,12 @@ void VirtualGPU::profilingEnd(amd::Command& command) {
if (!timestamp_->HwProfiling()) {
timestamp_->end();
}
assert(Barriers().IsExternalSignalListEmpty());
command.setData(timestamp_);
timestamp_ = nullptr;
}
if (AMD_DIRECT_DISPATCH) {
assert(retainExternalSignals_ || Barriers().IsExternalSignalListEmpty());
}
}
// ================================================================================================
@@ -2991,6 +2996,7 @@ void VirtualGPU::submitKernel(amd::NDRangeKernelCommand& vcmd) {
// Add a dependency into the current queue on the coop queue
Barriers().AddExternalSignal(queue->Barriers().GetLastSignal());
hasPendingDispatch_ = true;
retainExternalSignals_ = true;
queue->profilingEnd(vcmd);
} else {
+7 -6
Ver fichero
@@ -458,12 +458,13 @@ class VirtualGPU : public device::VirtualDevice {
//! Queue state flags
union {
struct {
uint32_t hasPendingDispatch_ : 1; //!< A kernel dispatch is outstanding
uint32_t profiling_ : 1; //!< Profiling is enabled
uint32_t cooperative_ : 1; //!< Cooperative launch is enabled
uint32_t addSystemScope_ : 1; //!< Insert a system scope to the next aql
uint32_t tracking_created_ : 1; //!< Enabled if tracking object was properly initialized
uint32_t profilerAttached_ : 1; //!< Indicates if profiler is attached
uint32_t hasPendingDispatch_ : 1; //!< A kernel dispatch is outstanding
uint32_t profiling_ : 1; //!< Profiling is enabled
uint32_t cooperative_ : 1; //!< Cooperative launch is enabled
uint32_t addSystemScope_ : 1; //!< Insert a system scope to the next aql
uint32_t tracking_created_ : 1; //!< Enabled if tracking object was properly initialized
uint32_t profilerAttached_ : 1; //!< Indicates if profiler is attached
uint32_t retainExternalSignals_ : 1; //!< Indicate to retain external signal array
};
uint32_t state_;
};