mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:11:16 +08:00
Add CSR from Device to CommandQueue Change-Id: Iaccf3c73d25e357242837677777d0513e81f520e Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
35 lines
910 B
C++
35 lines
910 B
C++
/*
|
|
* Copyright (C) 2018 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "hw_cmds.h"
|
|
#include "runtime/command_queue/command_queue_hw.h"
|
|
#include "runtime/command_stream/command_stream_receiver.h"
|
|
#include "runtime/device/device.h"
|
|
|
|
namespace OCLRT {
|
|
|
|
template <typename GfxFamily>
|
|
cl_int CommandQueueHw<GfxFamily>::finish(bool dcFlush) {
|
|
getCommandStreamReceiver().flushBatchedSubmissions();
|
|
|
|
//as long as queue is blocked we need to stall.
|
|
while (isQueueBlocked())
|
|
;
|
|
|
|
auto taskCountToWaitFor = this->taskCount;
|
|
auto flushStampToWaitFor = this->flushStamp->peekStamp();
|
|
|
|
// Stall until HW reaches CQ taskCount
|
|
waitUntilComplete(taskCountToWaitFor, flushStampToWaitFor, false);
|
|
|
|
getCommandStreamReceiver().waitForTaskCountAndCleanAllocationList(taskCountToWaitFor, TEMPORARY_ALLOCATION);
|
|
|
|
return CL_SUCCESS;
|
|
}
|
|
} // namespace OCLRT
|