void GPUProgressTracking::waitUntilCompleted(SeqNum seqNum)
 {
     while (!hasCompleted(seqNum))
     {
         auto &executed = executedCommandLists;
         XOR_CHECK(!executed.empty(), "Nothing to wait for, deadlock!");
         executed.front().waitUntilCompleted();
     }
 }
Beispiel #2
0
	void AsyncOp::blockUntilComplete() const
	{
		if (mSyncData == nullptr)
		{
			LOGERR("No sync data is available. Cannot block until AsyncOp is complete.");
			return;
		}

		Lock lock(mSyncData->mMutex);
		while (!hasCompleted())
			mSyncData->mCondition.wait(lock);
	}
        bool GPUProgressTracking::hasBeenExecuted(SeqNum seqNum)
        {
            if (hasCompleted(seqNum))
                return true;

            if (seqNum > newestExecuted)
                return false;

            for (auto &c : executedCommandLists)
            {
                if (c.number() == seqNum)
                    return true;
            }

            return false;
        }