P4 to Git Change 1069392 by gandryey@gera-ubuntu14 on 2014/08/22 15:58:21

EPR #404714 - [CQE OCL][2.0][DTB]Opencl1.2 WF Conf. Math test failedon Pitcairn and Oland due to CL#1065597
	- FIx for TC regression after CL#1069020. Move the lock directly to the gsl flush() calls.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#332 edit
This commit is contained in:
foreman
2014-08-22 16:06:32 -04:00
orang tua 85d86251c1
melakukan 7cc2a2d6e3
+14 -13
Melihat File
@@ -2782,12 +2782,6 @@ VirtualGPU::awaitCompletion(CommandBatch* cb, const amd::Event* waitingEvent)
void
VirtualGPU::flush(amd::Command* list, bool wait)
{
//! @note: Even flush() requires a lock, because GSL can
//! defer destruction of internal memory objects and releases them
//! on GSL flush. If runtime calls another GSL flush at the same time,
//! then double release can occur.
amd::ScopedLock lock(execution());
CommandBatch* cb = NULL;
bool gpuCommand = false;
@@ -2807,13 +2801,20 @@ VirtualGPU::flush(amd::Command* list, bool wait)
cb = new CommandBatch(list, cal()->events_, cal()->lastTS_);
}
for (uint i = 0; i < AllEngines; ++i) {
flushDMA(i);
// Reset event so we won't try to wait again,
// if runtime didn't submit any commands
//! @note: it's safe to invalidate events, since
//! we already saved them with the batch creation step above
cal_.events_[i].invalidate();
{
//! @note: flushDMA() requires a lock, because GSL can
//! defer destruction of internal memory objects and releases them
//! on GSL flush. If runtime calls another GSL flush at the same time,
//! then double release can occur.
amd::ScopedLock lock(execution());
for (uint i = 0; i < AllEngines; ++i) {
flushDMA(i);
// Reset event so we won't try to wait again,
// if runtime didn't submit any commands
//! @note: it's safe to invalidate events, since
//! we already saved them with the batch creation step above
cal_.events_[i].invalidate();
}
}
// Mark last TS as NULL, so runtime won't process empty batches with the old TS