mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
Rename an overload of waitUntilComplete to waitForAllEngines
- Overloaded functions were quite different, they should have different names - waitForLatestTaskCount function was redundant and hence its body was moved inside waitForAllEngines Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d211864410
commit
6d1e048327
@@ -187,15 +187,6 @@ bool CommandQueue::isCompleted(uint32_t gpgpuTaskCount, CopyEngineState bcsState
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandQueue::waitForLatestTaskCount() {
|
|
||||||
TimestampPacketContainer nodesToRelease;
|
|
||||||
if (deferredTimestampPackets) {
|
|
||||||
deferredTimestampPackets->swapNodes(nodesToRelease);
|
|
||||||
}
|
|
||||||
|
|
||||||
waitUntilComplete(taskCount, this->bcsState.taskCount, flushStamp->peekStamp(), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CommandQueue::waitUntilComplete(uint32_t gpgpuTaskCountToWait, uint32_t bcsTaskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep) {
|
void CommandQueue::waitUntilComplete(uint32_t gpgpuTaskCountToWait, uint32_t bcsTaskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep) {
|
||||||
WAIT_ENTER()
|
WAIT_ENTER()
|
||||||
|
|
||||||
@@ -918,13 +909,18 @@ void CommandQueue::aubCaptureHook(bool &blocking, bool &clearAllDependencies, co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandQueue::waitUntilComplete(bool blockedQueue, PrintfHandler *printfHandler) {
|
void CommandQueue::waitForAllEngines(bool blockedQueue, PrintfHandler *printfHandler) {
|
||||||
if (blockedQueue) {
|
if (blockedQueue) {
|
||||||
while (isQueueBlocked()) {
|
while (isQueueBlocked()) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
waitForLatestTaskCount();
|
TimestampPacketContainer nodesToRelease;
|
||||||
|
if (deferredTimestampPackets) {
|
||||||
|
deferredTimestampPackets->swapNodes(nodesToRelease);
|
||||||
|
}
|
||||||
|
|
||||||
|
waitUntilComplete(taskCount, this->bcsState.taskCount, flushStamp->peekStamp(), false);
|
||||||
|
|
||||||
if (printfHandler) {
|
if (printfHandler) {
|
||||||
printfHandler->printEnqueueOutput();
|
printfHandler->printEnqueueOutput();
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
|
|||||||
MOCKABLE_VIRTUAL bool isQueueBlocked();
|
MOCKABLE_VIRTUAL bool isQueueBlocked();
|
||||||
|
|
||||||
MOCKABLE_VIRTUAL void waitUntilComplete(uint32_t gpgpuTaskCountToWait, uint32_t bcsTaskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep);
|
MOCKABLE_VIRTUAL void waitUntilComplete(uint32_t gpgpuTaskCountToWait, uint32_t bcsTaskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep);
|
||||||
MOCKABLE_VIRTUAL void waitUntilComplete(bool blockedQueue, PrintfHandler *printfHandler);
|
MOCKABLE_VIRTUAL void waitForAllEngines(bool blockedQueue, PrintfHandler *printfHandler);
|
||||||
|
|
||||||
static uint32_t getTaskLevelFromWaitList(uint32_t taskLevel,
|
static uint32_t getTaskLevelFromWaitList(uint32_t taskLevel,
|
||||||
cl_uint numEventsInWaitList,
|
cl_uint numEventsInWaitList,
|
||||||
@@ -360,7 +360,6 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
|
|||||||
MOCKABLE_VIRTUAL bool blitEnqueueImageAllowed(const size_t *origin, const size_t *region, const Image &image) const;
|
MOCKABLE_VIRTUAL bool blitEnqueueImageAllowed(const size_t *origin, const size_t *region, const Image &image) const;
|
||||||
void aubCaptureHook(bool &blocking, bool &clearAllDependencies, const MultiDispatchInfo &multiDispatchInfo);
|
void aubCaptureHook(bool &blocking, bool &clearAllDependencies, const MultiDispatchInfo &multiDispatchInfo);
|
||||||
virtual bool obtainTimestampPacketForCacheFlush(bool isCacheFlushRequired) const = 0;
|
virtual bool obtainTimestampPacketForCacheFlush(bool isCacheFlushRequired) const = 0;
|
||||||
void waitForLatestTaskCount();
|
|
||||||
|
|
||||||
Context *context = nullptr;
|
Context *context = nullptr;
|
||||||
ClDevice *device = nullptr;
|
ClDevice *device = nullptr;
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
|
|||||||
commandStreamRecieverOwnership.unlock();
|
commandStreamRecieverOwnership.unlock();
|
||||||
|
|
||||||
if (blocking) {
|
if (blocking) {
|
||||||
waitUntilComplete(blockQueue, (blockQueue ? nullptr : printfHandler.get()));
|
waitForAllEngines(blockQueue, (blockQueue ? nullptr : printfHandler.get()));
|
||||||
}
|
}
|
||||||
if (migratedMemory) {
|
if (migratedMemory) {
|
||||||
getGpgpuCommandStreamReceiver().flushBatchedSubmissions();
|
getGpgpuCommandStreamReceiver().flushBatchedSubmissions();
|
||||||
@@ -1249,7 +1249,7 @@ void CommandQueueHw<GfxFamily>::enqueueBlit(const MultiDispatchInfo &multiDispat
|
|||||||
commandStreamRecieverOwnership.unlock();
|
commandStreamRecieverOwnership.unlock();
|
||||||
|
|
||||||
if (blocking) {
|
if (blocking) {
|
||||||
waitUntilComplete(blockQueue, nullptr);
|
waitForAllEngines(blockQueue, nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,12 +19,8 @@ cl_int CommandQueueHw<GfxFamily>::finish() {
|
|||||||
return CL_OUT_OF_RESOURCES;
|
return CL_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
//as long as queue is blocked we need to stall.
|
// Stall until HW reaches taskCount on all its engines
|
||||||
while (isQueueBlocked())
|
waitForAllEngines(true, nullptr);
|
||||||
;
|
|
||||||
|
|
||||||
// Stall until HW reaches CQ taskCount
|
|
||||||
waitForLatestTaskCount();
|
|
||||||
|
|
||||||
return CL_SUCCESS;
|
return CL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1031,7 +1031,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenUpdateTaskCountFromWaitSetWhe
|
|||||||
mockCsr->useGpuIdleImplicitFlush = false;
|
mockCsr->useGpuIdleImplicitFlush = false;
|
||||||
mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
|
mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
|
||||||
|
|
||||||
commandQueue.waitUntilComplete(false, nullptr);
|
commandQueue.waitForAllEngines(false, nullptr);
|
||||||
|
|
||||||
parseCommands<FamilyType>(mockCsr->getCS(4096u));
|
parseCommands<FamilyType>(mockCsr->getCS(4096u));
|
||||||
auto itorPipeControl = find<typename FamilyType::PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
auto itorPipeControl = find<typename FamilyType::PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||||
@@ -1059,7 +1059,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenEnabledDirectSubmissionUpdate
|
|||||||
mockCsr->useGpuIdleImplicitFlush = false;
|
mockCsr->useGpuIdleImplicitFlush = false;
|
||||||
mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
|
mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
|
||||||
|
|
||||||
commandQueue.waitUntilComplete(false, nullptr);
|
commandQueue.waitForAllEngines(false, nullptr);
|
||||||
|
|
||||||
parseCommands<FamilyType>(mockCsr->getCS(4096u));
|
parseCommands<FamilyType>(mockCsr->getCS(4096u));
|
||||||
auto itorPipeControl = find<typename FamilyType::PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
auto itorPipeControl = find<typename FamilyType::PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ HWTEST_F(PrintfHandlerTests, givenPrintfHandlerWhenEnqueueIsBlockedThenDontUsePr
|
|||||||
using CommandQueueHw<FamilyType>::CommandQueueHw;
|
using CommandQueueHw<FamilyType>::CommandQueueHw;
|
||||||
using CommandQueueHw<FamilyType>::enqueueKernel;
|
using CommandQueueHw<FamilyType>::enqueueKernel;
|
||||||
|
|
||||||
void waitUntilComplete(bool blockedQueue, PrintfHandler *printfHandler) override {
|
void waitForAllEngines(bool blockedQueue, PrintfHandler *printfHandler) override {
|
||||||
waitCalled = true;
|
waitCalled = true;
|
||||||
printfHandlerUsedForWait = printfHandler;
|
printfHandlerUsedForWait = printfHandler;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user