mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 01:35:20 +08:00
performance: Stop direct submission before removing host ptrs
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
34cfba4a2a
commit
4fd219cdbb
@@ -358,6 +358,9 @@ class CommandStreamReceiver {
|
||||
|
||||
virtual void stopDirectSubmission(bool blocking) {}
|
||||
|
||||
virtual void stopDirectSubmissionForHostptrDestroy() {}
|
||||
virtual void startDirectSubmissionForHostptrDestroy() {}
|
||||
|
||||
virtual QueueThrottle getLastDirectSubmissionThrottle() = 0;
|
||||
|
||||
bool isStaticWorkPartitioningEnabled() const {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -39,7 +39,16 @@ void InternalAllocationStorage::storeAllocationWithTaskCount(std::unique_ptr<Gra
|
||||
}
|
||||
|
||||
void InternalAllocationStorage::cleanAllocationList(TaskCountType waitTaskCount, uint32_t allocationUsage) {
|
||||
bool restartDirectSubmission = allocationUsage == TEMPORARY_ALLOCATION && !allocationLists[allocationUsage].peekIsEmpty();
|
||||
if (restartDirectSubmission) {
|
||||
this->commandStreamReceiver.stopDirectSubmissionForHostptrDestroy();
|
||||
}
|
||||
|
||||
freeAllocationsList(waitTaskCount, allocationLists[allocationUsage]);
|
||||
|
||||
if (restartDirectSubmission) {
|
||||
this->commandStreamReceiver.startDirectSubmissionForHostptrDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
void InternalAllocationStorage::freeAllocationsList(TaskCountType waitTaskCount, AllocationsList &allocationsList) {
|
||||
|
||||
@@ -31,6 +31,9 @@ class WddmCommandStreamReceiver : public DeviceCommandStreamReceiver<GfxFamily>
|
||||
bool waitForFlushStamp(FlushStamp &flushStampToWait) override;
|
||||
bool isTlbFlushRequiredForStateCacheFlush() override;
|
||||
|
||||
void stopDirectSubmissionForHostptrDestroy() override;
|
||||
void startDirectSubmissionForHostptrDestroy() override;
|
||||
|
||||
WddmMemoryManager *getMemoryManager() const;
|
||||
Wddm *peekWddm() const {
|
||||
return wddm;
|
||||
|
||||
@@ -157,6 +157,20 @@ bool WddmCommandStreamReceiver<GfxFamily>::waitForFlushStamp(FlushStamp &flushSt
|
||||
return wddm->waitFromCpu(flushStampToWait, static_cast<OsContextWin *>(this->osContext)->getResidencyController().getMonitoredFence(), false);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void WddmCommandStreamReceiver<GfxFamily>::stopDirectSubmissionForHostptrDestroy() {
|
||||
auto lock = this->obtainUniqueOwnership();
|
||||
this->stopDirectSubmission(false);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void WddmCommandStreamReceiver<GfxFamily>::startDirectSubmissionForHostptrDestroy() {
|
||||
if (this->isAnyDirectSubmissionEnabled()) {
|
||||
auto lock = this->obtainUniqueOwnership();
|
||||
this->flushTagUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool WddmCommandStreamReceiver<GfxFamily>::isTlbFlushRequiredForStateCacheFlush() {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user