mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-28 00:03:14 +08:00
performance: allocate states vector together with command list
Allocating vector backing storage on stack makes it allocated together with the whole command list object. So no second use of heap for the state changes vector data. Related-To: NEO-7828 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9e44344419
commit
7b0283e810
@@ -50,7 +50,6 @@ CommandQueueImp::CommandQueueImp(Device *device, NEO::CommandStreamReceiver *csr
|
||||
if (overrideUseKmdWaitFunction != -1) {
|
||||
useKmdWaitFunction = !!(overrideUseKmdWaitFunction);
|
||||
}
|
||||
this->stateChanges.reserve(CommandQueueImp::defaultCommandListStateChangeListSize);
|
||||
}
|
||||
|
||||
ze_result_t CommandQueueImp::destroy() {
|
||||
|
||||
@@ -762,8 +762,9 @@ size_t CommandQueueHw<gfxCoreFamily>::estimateLinearStreamSizeComplementary(
|
||||
ctx.spaceForResidency += estimateCommandListResidencySize(cmdList);
|
||||
|
||||
if (propertyScmDirty || propertyFeDirty || propertyPsDirty || propertySbaDirty || frontEndReturnPoint || propertyPreemptionDirty) {
|
||||
CommandListDirtyFlags dirtyFlags = {propertyScmDirty, propertyFeDirty, propertyPsDirty, propertySbaDirty, frontEndReturnPoint, propertyPreemptionDirty};
|
||||
this->stateChanges.emplace_back(stagingState, cmdList, dirtyFlags, ctx.statePreemption, i);
|
||||
CommandListRequiredStateChange stateChange(stagingState, cmdList, {propertyScmDirty, propertyFeDirty, propertyPsDirty, propertySbaDirty, frontEndReturnPoint, propertyPreemptionDirty}, ctx.statePreemption, i);
|
||||
this->stateChanges.push_back(stateChange);
|
||||
|
||||
linearStreamSizeEstimate += this->estimateCommandListPrimaryStart(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "shared/source/command_stream/task_count_helper.h"
|
||||
#include "shared/source/command_stream/wait_status.h"
|
||||
#include "shared/source/helpers/completion_stamp.h"
|
||||
#include "shared/source/utilities/stackvec.h"
|
||||
|
||||
#include "level_zero/core/source/cmdqueue/cmdqueue.h"
|
||||
|
||||
@@ -125,15 +126,15 @@ struct CommandQueueImp : public CommandQueue {
|
||||
uint32_t cmdListIndex = 0;
|
||||
};
|
||||
|
||||
using CommandListStateChangeList = std::vector<CommandListRequiredStateChange>;
|
||||
using CommandListStateChangeList = StackVec<CommandListRequiredStateChange, CommandQueueImp::defaultCommandListStateChangeListSize>;
|
||||
|
||||
CommandListStateChangeList stateChanges;
|
||||
CommandBufferManager buffers;
|
||||
NEO::LinearStream commandStream{};
|
||||
NEO::LinearStream firstCmdListStream{};
|
||||
NEO::HeapContainer heapContainer;
|
||||
ze_command_queue_desc_t desc;
|
||||
std::vector<Kernel *> printfKernelContainer;
|
||||
CommandListStateChangeList stateChanges;
|
||||
|
||||
std::atomic<TaskCountType> taskCount{0};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user