mirror of
https://github.com/intel/compute-runtime.git
synced 2025-06-28 17:58:30 +08:00

Change-Id: Ifc808822399a100745a9d81bb5f6e45903a895fa Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
34 lines
791 B
C++
34 lines
791 B
C++
/*
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "runtime/command_queue/command_queue_hw.h"
|
|
#include "runtime/command_stream/command_stream_receiver.h"
|
|
#include "runtime/device/device.h"
|
|
|
|
#include "hw_cmds.h"
|
|
|
|
namespace NEO {
|
|
|
|
template <typename GfxFamily>
|
|
cl_int CommandQueueHw<GfxFamily>::finish() {
|
|
getGpgpuCommandStreamReceiver().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);
|
|
|
|
return CL_SUCCESS;
|
|
}
|
|
} // namespace NEO
|