[perf] simplify memory layout of command container class

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2023-03-16 10:09:21 +00:00
committed by Compute-Runtime-Automation
parent bac3c93e45
commit 38e50007f7
19 changed files with 103 additions and 92 deletions

View File

@@ -164,10 +164,10 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
this->signalAllEventPackets = L0GfxCoreHelper::useSignalAllEventPackets(hwInfo); this->signalAllEventPackets = L0GfxCoreHelper::useSignalAllEventPackets(hwInfo);
this->dynamicHeapRequired = NEO::EncodeDispatchKernel<GfxFamily>::isDshNeeded(device->getDeviceInfo()); this->dynamicHeapRequired = NEO::EncodeDispatchKernel<GfxFamily>::isDshNeeded(device->getDeviceInfo());
this->doubleSbaWa = productHelper.isAdditionalStateBaseAddressWARequired(hwInfo); this->doubleSbaWa = productHelper.isAdditionalStateBaseAddressWARequired(hwInfo);
this->commandContainer.doubleSbaWa = this->doubleSbaWa; this->commandContainer.doubleSbaWaRef() = this->doubleSbaWa;
this->defaultMocsIndex = (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1); this->defaultMocsIndex = (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1);
this->l1CachePolicyData.init(productHelper); this->l1CachePolicyData.init(productHelper);
this->commandContainer.l1CachePolicyData = &this->l1CachePolicyData; this->commandContainer.l1CachePolicyDataRef() = &this->l1CachePolicyData;
this->cmdListHeapAddressModel = L0GfxCoreHelper::getHeapAddressModel(rootDeviceEnvironment); this->cmdListHeapAddressModel = L0GfxCoreHelper::getHeapAddressModel(rootDeviceEnvironment);
this->requiredStreamState.initSupport(rootDeviceEnvironment); this->requiredStreamState.initSupport(rootDeviceEnvironment);
this->finalStreamState.initSupport(rootDeviceEnvironment); this->finalStreamState.initSupport(rootDeviceEnvironment);
@@ -210,7 +210,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
if (!this->pipelineSelectStateTracking) { if (!this->pipelineSelectStateTracking) {
// allow systolic support set in container when tracking disabled // allow systolic support set in container when tracking disabled
// setting systolic support allows dispatching untracked command in legacy mode // setting systolic support allows dispatching untracked command in legacy mode
commandContainer.systolicModeSupport = this->systolicModeSupport; commandContainer.systolicModeSupportRef() = this->systolicModeSupport;
} }
ze_result_t returnType = parseErrorCode(returnValue); ze_result_t returnType = parseErrorCode(returnValue);
@@ -247,7 +247,7 @@ inline ze_result_t CommandListCoreFamily<gfxCoreFamily>::executeCommandListImmed
} }
if (this->isCopyOnly() && !this->isSyncModeQueue && !this->isTbxMode) { if (this->isCopyOnly() && !this->isSyncModeQueue && !this->isTbxMode) {
this->commandContainer.currentLinearStreamStartOffset = this->commandContainer.getCommandStream()->getUsed(); this->commandContainer.currentLinearStreamStartOffsetRef() = this->commandContainer.getCommandStream()->getUsed();
this->handlePostSubmissionState(); this->handlePostSubmissionState();
} else { } else {
const auto synchronizationResult = cmdQImmediate->synchronize(std::numeric_limits<uint64_t>::max()); const auto synchronizationResult = cmdQImmediate->synchronize(std::numeric_limits<uint64_t>::max());

View File

@@ -550,7 +550,7 @@ void CommandQueueHw<gfxCoreFamily>::setupCmdListsAndContextParams(
if (commandContainer.getIndirectHeap(NEO::HeapType::SURFACE_STATE) != nullptr) { if (commandContainer.getIndirectHeap(NEO::HeapType::SURFACE_STATE) != nullptr) {
heapContainer.push_back(commandContainer.getIndirectHeap(NEO::HeapType::SURFACE_STATE)->getGraphicsAllocation()); heapContainer.push_back(commandContainer.getIndirectHeap(NEO::HeapType::SURFACE_STATE)->getGraphicsAllocation());
} }
for (auto &element : commandContainer.sshAllocations) { for (auto &element : commandContainer.getSshAllocations()) {
heapContainer.push_back(element); heapContainer.push_back(element);
} }
} }
@@ -905,7 +905,7 @@ void CommandQueueHw<gfxCoreFamily>::programOneCmdListBatchBufferStart(CommandLis
auto allocation = cmdBufferAllocations[iter]; auto allocation = cmdBufferAllocations[iter];
uint64_t startOffset = allocation->getGpuAddress(); uint64_t startOffset = allocation->getGpuAddress();
if (isCommandListImmediate && (iter == (cmdBufferCount - 1))) { if (isCommandListImmediate && (iter == (cmdBufferCount - 1))) {
startOffset = ptrOffset(allocation->getGpuAddress(), commandContainer.currentLinearStreamStartOffset); startOffset = ptrOffset(allocation->getGpuAddress(), commandContainer.currentLinearStreamStartOffsetRef());
} }
NEO::EncodeBatchBufferStartOrEnd<GfxFamily>::programBatchBufferStart(&cmdStream, startOffset, true, false, false); NEO::EncodeBatchBufferStartOrEnd<GfxFamily>::programBatchBufferStart(&cmdStream, startOffset, true, false, false);
if (returnPointsSize > 0) { if (returnPointsSize > 0) {

View File

@@ -289,7 +289,7 @@ HWTEST2_F(CommandListCreate,
ze_result_t result = ZE_RESULT_SUCCESS; ze_result_t result = ZE_RESULT_SUCCESS;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result)); std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result));
auto &commandContainer = commandList->getCmdContainer(); auto &commandContainer = commandList->getCmdContainer();
commandContainer.slmSize = 0; commandContainer.slmSizeRef() = 0;
void *srcBuffer = reinterpret_cast<void *>(0x1234); void *srcBuffer = reinterpret_cast<void *>(0x1234);
void *dstBuffer = reinterpret_cast<void *>(0x2345); void *dstBuffer = reinterpret_cast<void *>(0x2345);
@@ -346,7 +346,7 @@ HWTEST2_F(CommandListCreate,
ze_result_t result = ZE_RESULT_SUCCESS; ze_result_t result = ZE_RESULT_SUCCESS;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result)); std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result));
auto &commandContainer = commandList->getCmdContainer(); auto &commandContainer = commandList->getCmdContainer();
commandContainer.slmSize = 0; commandContainer.slmSizeRef() = 0;
void *srcBuffer = nullptr; void *srcBuffer = nullptr;
void *dstBuffer = nullptr; void *dstBuffer = nullptr;
@@ -410,7 +410,7 @@ HWTEST2_F(CommandListCreate,
ze_result_t result = ZE_RESULT_SUCCESS; ze_result_t result = ZE_RESULT_SUCCESS;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result)); std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result));
auto &commandContainer = commandList->getCmdContainer(); auto &commandContainer = commandList->getCmdContainer();
commandContainer.slmSize = 0; commandContainer.slmSizeRef() = 0;
void *dstBuffer = nullptr; void *dstBuffer = nullptr;
ze_device_mem_alloc_desc_t deviceDesc = {}; ze_device_mem_alloc_desc_t deviceDesc = {};
@@ -466,7 +466,7 @@ HWTEST2_F(CommandListCreate,
ze_result_t result = ZE_RESULT_SUCCESS; ze_result_t result = ZE_RESULT_SUCCESS;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result)); std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result));
auto &commandContainer = commandList->getCmdContainer(); auto &commandContainer = commandList->getCmdContainer();
commandContainer.slmSize = 0; commandContainer.slmSizeRef() = 0;
void *dstBuffer = nullptr; void *dstBuffer = nullptr;
ze_device_mem_alloc_desc_t deviceDesc = {}; ze_device_mem_alloc_desc_t deviceDesc = {};
@@ -523,7 +523,7 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenMemoryFillHavingHostMemoryWithS
ze_result_t result = ZE_RESULT_SUCCESS; ze_result_t result = ZE_RESULT_SUCCESS;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result)); std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result));
auto &commandContainer = commandList->getCmdContainer(); auto &commandContainer = commandList->getCmdContainer();
commandContainer.slmSize = 0; commandContainer.slmSizeRef() = 0;
void *dstBuffer = nullptr; void *dstBuffer = nullptr;
ze_host_mem_alloc_desc_t hostDesc = {}; ze_host_mem_alloc_desc_t hostDesc = {};
@@ -578,7 +578,7 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenMemoryFillHavingEventsWithDevic
ze_result_t result = ZE_RESULT_SUCCESS; ze_result_t result = ZE_RESULT_SUCCESS;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result)); std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result));
auto &commandContainer = commandList->getCmdContainer(); auto &commandContainer = commandList->getCmdContainer();
commandContainer.slmSize = 0; commandContainer.slmSizeRef() = 0;
void *dstBuffer = nullptr; void *dstBuffer = nullptr;
ze_host_mem_alloc_desc_t hostDesc = {}; ze_host_mem_alloc_desc_t hostDesc = {};
@@ -637,7 +637,7 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenMemoryFillHavingEventsWithDevic
ze_result_t result = ZE_RESULT_SUCCESS; ze_result_t result = ZE_RESULT_SUCCESS;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result)); std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result));
auto &commandContainer = commandList->getCmdContainer(); auto &commandContainer = commandList->getCmdContainer();
commandContainer.slmSize = 0; commandContainer.slmSizeRef() = 0;
void *dstBuffer = nullptr; void *dstBuffer = nullptr;
ze_host_mem_alloc_desc_t hostDesc = {}; ze_host_mem_alloc_desc_t hostDesc = {};

View File

@@ -744,7 +744,7 @@ HWTEST_F(CommandListAppendLaunchKernel, givenCommandListWhenResetCalledThenState
ASSERT_EQ(commandListControl->getPrintfKernelContainer().size(), ASSERT_EQ(commandListControl->getPrintfKernelContainer().size(),
commandList->getPrintfKernelContainer().size()); commandList->getPrintfKernelContainer().size());
ASSERT_EQ(commandListControl->getCmdContainer().getCommandStream()->getUsed(), commandList->getCmdContainer().getCommandStream()->getUsed()); ASSERT_EQ(commandListControl->getCmdContainer().getCommandStream()->getUsed(), commandList->getCmdContainer().getCommandStream()->getUsed());
ASSERT_EQ(commandListControl->getCmdContainer().slmSize, commandList->getCmdContainer().slmSize); ASSERT_EQ(commandListControl->getCmdContainer().slmSizeRef(), commandList->getCmdContainer().slmSizeRef());
for (uint32_t i = 0; i < NEO::HeapType::NUM_TYPES; i++) { for (uint32_t i = 0; i < NEO::HeapType::NUM_TYPES; i++) {
auto heapType = static_cast<NEO::HeapType>(i); auto heapType = static_cast<NEO::HeapType>(i);

View File

@@ -1157,8 +1157,8 @@ HWTEST2_F(ExecuteCommandListTests, givenExecuteCommandListWhenItReturnsThenConta
NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u);
NEO::GraphicsAllocation graphicsAllocation2(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); NEO::GraphicsAllocation graphicsAllocation2(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u);
commandList->commandContainer.sshAllocations.push_back(&graphicsAllocation1); commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation1);
commandList->commandContainer.sshAllocations.push_back(&graphicsAllocation2); commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation2);
commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false); commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
@@ -1215,8 +1215,8 @@ HWTEST2_F(CommandQueueDestroy, givenCommandQueueAndCommandListWithSshAndScratchW
NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u);
NEO::GraphicsAllocation graphicsAllocation2(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); NEO::GraphicsAllocation graphicsAllocation2(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u);
commandList->commandContainer.sshAllocations.push_back(&graphicsAllocation1); commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation1);
commandList->commandContainer.sshAllocations.push_back(&graphicsAllocation2); commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation2);
commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false); commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
@@ -1241,8 +1241,8 @@ HWTEST2_F(CommandQueueDestroy, givenCommandQueueAndCommandListWithSshAndPrivateS
NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u);
NEO::GraphicsAllocation graphicsAllocation2(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); NEO::GraphicsAllocation graphicsAllocation2(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u);
commandList->commandContainer.sshAllocations.push_back(&graphicsAllocation1); commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation1);
commandList->commandContainer.sshAllocations.push_back(&graphicsAllocation2); commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation2);
commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false); commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);

View File

@@ -179,15 +179,14 @@ class CommandContainer : public NonCopyableOrMovableClass {
stateBaseAddressTracking = value; stateBaseAddressTracking = value;
} }
HeapContainer sshAllocations; bool &systolicModeSupportRef() { return systolicModeSupport; }
uint64_t currentLinearStreamStartOffset = 0u; bool &lastPipelineSelectModeRequiredRef() { return lastPipelineSelectModeRequired; }
uint32_t slmSize = std::numeric_limits<uint32_t>::max(); L1CachePolicy *&l1CachePolicyDataRef() { return l1CachePolicyData; }
uint32_t nextIddInBlock = 0; bool &doubleSbaWaRef() { return doubleSbaWa; }
L1CachePolicy *l1CachePolicyData = nullptr; uint32_t &slmSizeRef() { return slmSize; }
bool lastPipelineSelectModeRequired = false; uint32_t &nextIddInBlockRef() { return nextIddInBlock; }
bool lastSentUseGlobalAtomics = false; HeapContainer &getSshAllocations() { return sshAllocations; }
bool systolicModeSupport = false; uint64_t &currentLinearStreamStartOffsetRef() { return currentLinearStreamStartOffset; }
bool doubleSbaWa = false;
protected: protected:
size_t getAlignedCmdBufferSize() const; size_t getAlignedCmdBufferSize() const;
@@ -202,33 +201,39 @@ class CommandContainer : public NonCopyableOrMovableClass {
GraphicsAllocation *allocationIndirectHeaps[HeapType::NUM_TYPES] = {}; GraphicsAllocation *allocationIndirectHeaps[HeapType::NUM_TYPES] = {};
std::unique_ptr<IndirectHeap> indirectHeaps[HeapType::NUM_TYPES]; std::unique_ptr<IndirectHeap> indirectHeaps[HeapType::NUM_TYPES];
HeapReserveData dynamicStateHeapReserveData;
HeapReserveData surfaceStateHeapReserveData;
CmdBufferContainer cmdBufferAllocations; CmdBufferContainer cmdBufferAllocations;
ResidencyContainer residencyContainer; ResidencyContainer residencyContainer;
std::vector<GraphicsAllocation *> deallocationContainer; std::vector<GraphicsAllocation *> deallocationContainer;
HeapContainer sshAllocations;
HeapReserveData dynamicStateHeapReserveData;
HeapReserveData surfaceStateHeapReserveData;
std::unique_ptr<HeapHelper> heapHelper; std::unique_ptr<HeapHelper> heapHelper;
std::unique_ptr<LinearStream> commandStream; std::unique_ptr<LinearStream> commandStream;
std::unique_ptr<LinearStream> secondaryCommandStreamForImmediateCmdList; std::unique_ptr<LinearStream> secondaryCommandStreamForImmediateCmdList;
std::unique_ptr<AllocationsList> immediateReusableAllocationList;
uint64_t instructionHeapBaseAddress = 0u; uint64_t instructionHeapBaseAddress = 0u;
uint64_t indirectObjectHeapBaseAddress = 0u; uint64_t indirectObjectHeapBaseAddress = 0u;
uint64_t currentLinearStreamStartOffset = 0u;
void *iddBlock = nullptr; void *iddBlock = nullptr;
Device *device = nullptr; Device *device = nullptr;
AllocationsList *reusableAllocationList = nullptr; AllocationsList *reusableAllocationList = nullptr;
std::unique_ptr<AllocationsList> immediateReusableAllocationList;
size_t reservedSshSize = 0; size_t reservedSshSize = 0;
CommandStreamReceiver *immediateCmdListCsr = nullptr; CommandStreamReceiver *immediateCmdListCsr = nullptr;
IndirectHeap *sharedSshCsrHeap = nullptr; IndirectHeap *sharedSshCsrHeap = nullptr;
IndirectHeap *sharedDshCsrHeap = nullptr; IndirectHeap *sharedDshCsrHeap = nullptr;
size_t defaultSshSize = 0; size_t defaultSshSize = 0;
L1CachePolicy *l1CachePolicyData = nullptr;
uint32_t dirtyHeaps = std::numeric_limits<uint32_t>::max(); uint32_t dirtyHeaps = std::numeric_limits<uint32_t>::max();
uint32_t numIddsPerBlock = 64; uint32_t numIddsPerBlock = 64;
HeapAddressModel heapAddressModel = HeapAddressModel::PrivateHeaps; HeapAddressModel heapAddressModel = HeapAddressModel::PrivateHeaps;
uint32_t slmSize = std::numeric_limits<uint32_t>::max();
uint32_t nextIddInBlock = 0;
bool isFlushTaskUsedForImmediate = false; bool isFlushTaskUsedForImmediate = false;
bool isHandleFenceCompletionRequired = false; bool isHandleFenceCompletionRequired = false;
@@ -236,6 +241,10 @@ class CommandContainer : public NonCopyableOrMovableClass {
bool useSecondaryCommandStream = false; bool useSecondaryCommandStream = false;
bool indirectHeapInLocalMemory = false; bool indirectHeapInLocalMemory = false;
bool stateBaseAddressTracking = false; bool stateBaseAddressTracking = false;
bool lastPipelineSelectModeRequired = false;
bool lastSentUseGlobalAtomics = false;
bool systolicModeSupport = false;
bool doubleSbaWa = false;
}; };
} // namespace NEO } // namespace NEO

View File

@@ -547,7 +547,7 @@ void EncodeSurfaceState<Family>::encodeImplicitScalingParams(const EncodeSurface
template <typename Family> template <typename Family>
void *EncodeDispatchKernel<Family>::getInterfaceDescriptor(CommandContainer &container, IndirectHeap *childDsh, uint32_t &iddOffset) { void *EncodeDispatchKernel<Family>::getInterfaceDescriptor(CommandContainer &container, IndirectHeap *childDsh, uint32_t &iddOffset) {
if (container.nextIddInBlock == container.getNumIddPerBlock()) { if (container.nextIddInBlockRef() == container.getNumIddPerBlock()) {
if (ApiSpecificConfig::getBindlessConfiguration()) { if (ApiSpecificConfig::getBindlessConfiguration()) {
container.getDevice()->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::BindlesHeapType::GLOBAL_DSH)->align(EncodeStates<Family>::alignInterfaceDescriptorData); container.getDevice()->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::BindlesHeapType::GLOBAL_DSH)->align(EncodeStates<Family>::alignInterfaceDescriptorData);
container.setIddBlock(container.getDevice()->getBindlessHeapsHelper()->getSpaceInHeap(sizeof(INTERFACE_DESCRIPTOR_DATA) * container.getNumIddPerBlock(), BindlessHeapsHelper::BindlesHeapType::GLOBAL_DSH)); container.setIddBlock(container.getDevice()->getBindlessHeapsHelper()->getSpaceInHeap(sizeof(INTERFACE_DESCRIPTOR_DATA) * container.getNumIddPerBlock(), BindlessHeapsHelper::BindlesHeapType::GLOBAL_DSH));
@@ -563,12 +563,13 @@ void *EncodeDispatchKernel<Family>::getInterfaceDescriptor(CommandContainer &con
} }
container.setIddBlock(heapPointer); container.setIddBlock(heapPointer);
} }
container.nextIddInBlock = 0; container.nextIddInBlockRef() = 0;
} }
iddOffset = container.nextIddInBlock; iddOffset = container.nextIddInBlockRef();
auto interfaceDescriptorData = static_cast<INTERFACE_DESCRIPTOR_DATA *>(container.getIddBlock()); auto interfaceDescriptorData = static_cast<INTERFACE_DESCRIPTOR_DATA *>(container.getIddBlock());
return &interfaceDescriptorData[container.nextIddInBlock++]; container.nextIddInBlockRef()++;
return &interfaceDescriptorData[iddOffset];
} }
template <typename Family> template <typename Family>

View File

@@ -192,7 +192,7 @@ void EncodeDispatchKernel<Family>::encode(CommandContainer &container, EncodeDis
auto slmSizeNew = args.dispatchInterface->getSlmTotalSize(); auto slmSizeNew = args.dispatchInterface->getSlmTotalSize();
bool dirtyHeaps = container.isAnyHeapDirty(); bool dirtyHeaps = container.isAnyHeapDirty();
bool flush = container.slmSize != slmSizeNew || dirtyHeaps || args.requiresUncachedMocs; bool flush = container.slmSizeRef() != slmSizeNew || dirtyHeaps || args.requiresUncachedMocs;
if (flush) { if (flush) {
PipeControlArgs syncArgs; PipeControlArgs syncArgs;
@@ -207,8 +207,8 @@ void EncodeDispatchKernel<Family>::encode(CommandContainer &container, EncodeDis
auto gmmHelper = container.getDevice()->getGmmHelper(); auto gmmHelper = container.getDevice()->getGmmHelper();
uint32_t statelessMocsIndex = uint32_t statelessMocsIndex =
args.requiresUncachedMocs ? (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED) >> 1) : (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1); args.requiresUncachedMocs ? (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED) >> 1) : (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1);
auto l1CachePolicy = container.l1CachePolicyData->getL1CacheValue(false); auto l1CachePolicy = container.l1CachePolicyDataRef()->getL1CacheValue(false);
auto l1CachePolicyDebuggerActive = container.l1CachePolicyData->getL1CacheValue(true); auto l1CachePolicyDebuggerActive = container.l1CachePolicyDataRef()->getL1CacheValue(true);
EncodeStateBaseAddressArgs<Family> encodeStateBaseAddressArgs = { EncodeStateBaseAddressArgs<Family> encodeStateBaseAddressArgs = {
&container, // container &container, // container
sba, // sbaCmd sba, // sbaCmd
@@ -219,15 +219,15 @@ void EncodeDispatchKernel<Family>::encode(CommandContainer &container, EncodeDis
false, // useGlobalAtomics false, // useGlobalAtomics
false, // multiOsContextCapable false, // multiOsContextCapable
args.isRcs, // isRcs args.isRcs, // isRcs
container.doubleSbaWa}; // doubleSbaWa container.doubleSbaWaRef()}; // doubleSbaWa
EncodeStateBaseAddress<Family>::encode(encodeStateBaseAddressArgs); EncodeStateBaseAddress<Family>::encode(encodeStateBaseAddressArgs);
container.setDirtyStateForAllHeaps(false); container.setDirtyStateForAllHeaps(false);
args.requiresUncachedMocs = false; args.requiresUncachedMocs = false;
} }
if (container.slmSize != slmSizeNew) { if (container.slmSizeRef() != slmSizeNew) {
EncodeL3State<Family>::encode(container, slmSizeNew != 0u); EncodeL3State<Family>::encode(container, slmSizeNew != 0u);
container.slmSize = slmSizeNew; container.slmSizeRef() = slmSizeNew;
} }
} }

View File

@@ -66,8 +66,8 @@ void EncodeDispatchKernel<Family>::encode(CommandContainer &container, EncodeDis
} }
bool systolicModeRequired = kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode; bool systolicModeRequired = kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode;
if (container.systolicModeSupport && (container.lastPipelineSelectModeRequired != systolicModeRequired)) { if (container.systolicModeSupportRef() && (container.lastPipelineSelectModeRequiredRef() != systolicModeRequired)) {
container.lastPipelineSelectModeRequired = systolicModeRequired; container.lastPipelineSelectModeRequiredRef() = systolicModeRequired;
EncodeComputeMode<Family>::adjustPipelineSelect(container, kernelDescriptor); EncodeComputeMode<Family>::adjustPipelineSelect(container, kernelDescriptor);
} }
@@ -230,8 +230,8 @@ void EncodeDispatchKernel<Family>::encode(CommandContainer &container, EncodeDis
auto gmmHelper = container.getDevice()->getGmmHelper(); auto gmmHelper = container.getDevice()->getGmmHelper();
uint32_t statelessMocsIndex = uint32_t statelessMocsIndex =
args.requiresUncachedMocs ? (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED) >> 1) : (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1); args.requiresUncachedMocs ? (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED) >> 1) : (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1);
auto l1CachePolicy = container.l1CachePolicyData->getL1CacheValue(false); auto l1CachePolicy = container.l1CachePolicyDataRef()->getL1CacheValue(false);
auto l1CachePolicyDebuggerActive = container.l1CachePolicyData->getL1CacheValue(true); auto l1CachePolicyDebuggerActive = container.l1CachePolicyDataRef()->getL1CacheValue(true);
EncodeStateBaseAddressArgs<Family> encodeStateBaseAddressArgs = { EncodeStateBaseAddressArgs<Family> encodeStateBaseAddressArgs = {
&container, // container &container, // container
@@ -243,7 +243,7 @@ void EncodeDispatchKernel<Family>::encode(CommandContainer &container, EncodeDis
args.useGlobalAtomics, // useGlobalAtomics args.useGlobalAtomics, // useGlobalAtomics
args.partitionCount > 1, // multiOsContextCapable args.partitionCount > 1, // multiOsContextCapable
args.isRcs, // isRcs args.isRcs, // isRcs
container.doubleSbaWa}; // doubleSbaWa container.doubleSbaWaRef()}; // doubleSbaWa
EncodeStateBaseAddress<Family>::encode(encodeStateBaseAddressArgs); EncodeStateBaseAddress<Family>::encode(encodeStateBaseAddressArgs);
container.setDirtyStateForAllHeaps(false); container.setDirtyStateForAllHeaps(false);
} }
@@ -630,7 +630,7 @@ void EncodeComputeMode<Family>::adjustPipelineSelect(CommandContainer &container
PipelineSelectArgs pipelineSelectArgs; PipelineSelectArgs pipelineSelectArgs;
pipelineSelectArgs.systolicPipelineSelectMode = kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode; pipelineSelectArgs.systolicPipelineSelectMode = kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode;
pipelineSelectArgs.systolicPipelineSelectSupport = container.systolicModeSupport; pipelineSelectArgs.systolicPipelineSelectSupport = container.systolicModeSupportRef();
PreambleHelper<Family>::programPipelineSelect(container.getCommandStream(), PreambleHelper<Family>::programPipelineSelect(container.getCommandStream(),
pipelineSelectArgs, pipelineSelectArgs,

View File

@@ -103,7 +103,7 @@ void EncodeComputeMode<Family>::adjustPipelineSelect(CommandContainer &container
PipelineSelectArgs pipelineSelectArgs; PipelineSelectArgs pipelineSelectArgs;
pipelineSelectArgs.systolicPipelineSelectMode = kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode; pipelineSelectArgs.systolicPipelineSelectMode = kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode;
pipelineSelectArgs.systolicPipelineSelectSupport = container.systolicModeSupport; pipelineSelectArgs.systolicPipelineSelectSupport = container.systolicModeSupportRef();
PreambleHelper<Family>::programPipelineSelect(container.getCommandStream(), PreambleHelper<Family>::programPipelineSelect(container.getCommandStream(),
pipelineSelectArgs, pipelineSelectArgs,

View File

@@ -158,6 +158,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIs
EXPECT_NE(cmdContainer.getHeapHelper(), nullptr); EXPECT_NE(cmdContainer.getHeapHelper(), nullptr);
EXPECT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u); EXPECT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u);
EXPECT_NE(cmdContainer.getCommandStream(), nullptr); EXPECT_NE(cmdContainer.getCommandStream(), nullptr);
EXPECT_EQ(0u, cmdContainer.currentLinearStreamStartOffsetRef());
for (uint32_t i = 0; i < HeapType::NUM_TYPES; i++) { for (uint32_t i = 0; i < HeapType::NUM_TYPES; i++) {
auto heapType = static_cast<HeapType>(i); auto heapType = static_cast<HeapType>(i);
@@ -431,7 +432,7 @@ HWTEST_F(CommandContainerTest, givenNotEnoughSpaceInSSHWhenGettingHeapWithRequir
cmdContainer->getHeapWithRequiredSizeAndAlignment(HeapType::SURFACE_STATE, sizeof(RENDER_SURFACE_STATE), 0); cmdContainer->getHeapWithRequiredSizeAndAlignment(HeapType::SURFACE_STATE, sizeof(RENDER_SURFACE_STATE), 0);
EXPECT_EQ(4 * MemoryConstants::pageSize, heap->getUsed()); EXPECT_EQ(4 * MemoryConstants::pageSize, heap->getUsed());
EXPECT_EQ(cmdContainer->sshAllocations.size(), 1u); EXPECT_EQ(cmdContainer->getSshAllocations().size(), 1u);
} }
TEST_F(CommandContainerTest, givenAvailableSpaceWhenGetHeapWithRequiredSizeAndAlignmentCalledThenExistingAllocationIsReturned) { TEST_F(CommandContainerTest, givenAvailableSpaceWhenGetHeapWithRequiredSizeAndAlignmentCalledThenExistingAllocationIsReturned) {

View File

@@ -507,7 +507,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeDe
DebugManager.flags.ForceBtpPrefetchMode.set(-1); DebugManager.flags.ForceBtpPrefetchMode.set(-1);
cmdContainer.reset(new MyMockCommandContainer()); cmdContainer.reset(new MyMockCommandContainer());
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
cmdContainer->l1CachePolicyData = &l1CachePolicyData; cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
@@ -540,7 +540,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeDe
DebugManager.flags.ForceBtpPrefetchMode.set(0); DebugManager.flags.ForceBtpPrefetchMode.set(0);
cmdContainer.reset(new MyMockCommandContainer()); cmdContainer.reset(new MyMockCommandContainer());
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
cmdContainer->l1CachePolicyData = &l1CachePolicyData; cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
@@ -568,7 +568,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeDe
DebugManager.flags.ForceBtpPrefetchMode.set(1); DebugManager.flags.ForceBtpPrefetchMode.set(1);
cmdContainer.reset(new MyMockCommandContainer()); cmdContainer.reset(new MyMockCommandContainer());
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
cmdContainer->l1CachePolicyData = &l1CachePolicyData; cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
@@ -597,9 +597,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenCleanHeapsAndSlmNotCha
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
uint32_t dims[] = {2, 1, 1}; uint32_t dims[] = {2, 1, 1};
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder()); std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
cmdContainer->slmSize = 1; cmdContainer->slmSizeRef() = 1;
cmdContainer->setDirtyStateForAllHeaps(false); cmdContainer->setDirtyStateForAllHeaps(false);
dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSize; dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSizeRef();
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
@@ -616,9 +616,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenCleanHeapsAndSlmNotCha
HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenCleanHeapsAndSlmNotChangedAndUncachedMocsRequestedThenSBAIsProgrammedAndMocsAreSet) { HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenCleanHeapsAndSlmNotChangedAndUncachedMocsRequestedThenSBAIsProgrammedAndMocsAreSet) {
uint32_t dims[] = {2, 1, 1}; uint32_t dims[] = {2, 1, 1};
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder()); std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
cmdContainer->slmSize = 1; cmdContainer->slmSizeRef() = 1;
cmdContainer->setDirtyStateForAllHeaps(false); cmdContainer->setDirtyStateForAllHeaps(false);
dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSize; dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSizeRef();
bool requiresUncachedMocs = true; bool requiresUncachedMocs = true;
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
@@ -643,9 +643,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenDirtyHeapsAndSlmNotCha
uint32_t dims[] = {2, 1, 1}; uint32_t dims[] = {2, 1, 1};
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder()); std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
cmdContainer->slmSize = 1; cmdContainer->slmSizeRef() = 1;
cmdContainer->setDirtyStateForAllHeaps(true); cmdContainer->setDirtyStateForAllHeaps(true);
dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSize; dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSizeRef();
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
@@ -666,9 +666,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenDirtyHeapsWhenDispatch
uint32_t dims[] = {2, 1, 1}; uint32_t dims[] = {2, 1, 1};
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder()); std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
cmdContainer->slmSize = 1; cmdContainer->slmSizeRef() = 1;
cmdContainer->setDirtyStateForAllHeaps(true); cmdContainer->setDirtyStateForAllHeaps(true);
dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSize; dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSizeRef();
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
@@ -707,9 +707,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenCleanHeapsAndSlmChange
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder()); std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
cmdContainer->setDirtyStateForAllHeaps(false); cmdContainer->setDirtyStateForAllHeaps(false);
dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSize + 1; dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSizeRef() + 1;
auto slmSizeBefore = cmdContainer->slmSize; auto slmSizeBefore = cmdContainer->slmSizeRef();
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
@@ -721,7 +721,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenCleanHeapsAndSlmChange
auto itorPC = find<PIPE_CONTROL *>(commands.begin(), commands.end()); auto itorPC = find<PIPE_CONTROL *>(commands.begin(), commands.end());
ASSERT_NE(itorPC, commands.end()); ASSERT_NE(itorPC, commands.end());
EXPECT_EQ(slmSizeBefore + 1, cmdContainer->slmSize); EXPECT_EQ(slmSizeBefore + 1, cmdContainer->slmSizeRef());
} }
HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, giveNextIddInBlockZeroWhenDispatchKernelThenMediaInterfaceDescriptorEncoded) { HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, giveNextIddInBlockZeroWhenDispatchKernelThenMediaInterfaceDescriptorEncoded) {
@@ -734,7 +734,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, giveNextIddInBlockZeroWhenD
cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE)->align(EncodeStates<FamilyType>::alignInterfaceDescriptorData); cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE)->align(EncodeStates<FamilyType>::alignInterfaceDescriptorData);
cmdContainer->setIddBlock(cmdContainer->getHeapSpaceAllowGrow(HeapType::DYNAMIC_STATE, sizeof(INTERFACE_DESCRIPTOR_DATA) * cmdContainer->getNumIddPerBlock())); cmdContainer->setIddBlock(cmdContainer->getHeapSpaceAllowGrow(HeapType::DYNAMIC_STATE, sizeof(INTERFACE_DESCRIPTOR_DATA) * cmdContainer->getNumIddPerBlock()));
cmdContainer->nextIddInBlock = 0; cmdContainer->nextIddInBlockRef() = 0;
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
@@ -760,7 +760,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, giveNextIddInBlockZeroWhenD
cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE)->align(EncodeStates<FamilyType>::alignInterfaceDescriptorData); cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE)->align(EncodeStates<FamilyType>::alignInterfaceDescriptorData);
cmdContainer->setIddBlock(cmdContainer->getHeapSpaceAllowGrow(HeapType::DYNAMIC_STATE, sizeof(INTERFACE_DESCRIPTOR_DATA) * cmdContainer->getNumIddPerBlock())); cmdContainer->setIddBlock(cmdContainer->getHeapSpaceAllowGrow(HeapType::DYNAMIC_STATE, sizeof(INTERFACE_DESCRIPTOR_DATA) * cmdContainer->getNumIddPerBlock()));
cmdContainer->nextIddInBlock = cmdContainer->getNumIddPerBlock(); cmdContainer->nextIddInBlockRef() = cmdContainer->getNumIddPerBlock();
// ensure heap has no available space left so that it will be reallocated and set to dirty // ensure heap has no available space left so that it will be reallocated and set to dirty
auto heap = cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE); auto heap = cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE);
@@ -840,7 +840,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, giveNumSamplersOneAndNextID
cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE)->align(EncodeStates<FamilyType>::alignInterfaceDescriptorData); cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE)->align(EncodeStates<FamilyType>::alignInterfaceDescriptorData);
cmdContainer->setIddBlock(cmdContainer->getHeapSpaceAllowGrow(HeapType::DYNAMIC_STATE, sizeof(INTERFACE_DESCRIPTOR_DATA) * cmdContainer->getNumIddPerBlock())); cmdContainer->setIddBlock(cmdContainer->getHeapSpaceAllowGrow(HeapType::DYNAMIC_STATE, sizeof(INTERFACE_DESCRIPTOR_DATA) * cmdContainer->getNumIddPerBlock()));
cmdContainer->nextIddInBlock = cmdContainer->getNumIddPerBlock(); cmdContainer->nextIddInBlockRef() = cmdContainer->getNumIddPerBlock();
uint32_t dims[] = {2, 1, 1}; uint32_t dims[] = {2, 1, 1};
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder()); std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
@@ -1275,7 +1275,7 @@ HWTEST_F(BindlessCommandEncodeStatesContainerTest, givenBindlessKernelAndBindles
auto commandContainer = std::make_unique<CommandContainer>(); auto commandContainer = std::make_unique<CommandContainer>();
commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
commandContainer->setDirtyStateForAllHeaps(false); commandContainer->setDirtyStateForAllHeaps(false);
commandContainer->l1CachePolicyData = &l1CachePolicyData; commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->createBindlessHeapsHelper(pDevice->getMemoryManager(), pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->createBindlessHeapsHelper(pDevice->getMemoryManager(),
pDevice->getNumGenericSubDevices() > 1, pDevice->getNumGenericSubDevices() > 1,
@@ -1313,7 +1313,7 @@ HWTEST2_F(BindlessCommandEncodeStatesContainerTest, givenBindlessKernelAndBindle
auto commandContainer = std::make_unique<CommandContainer>(); auto commandContainer = std::make_unique<CommandContainer>();
commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
commandContainer->setDirtyStateForAllHeaps(false); commandContainer->setDirtyStateForAllHeaps(false);
commandContainer->l1CachePolicyData = &l1CachePolicyData; commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->createBindlessHeapsHelper(pDevice->getMemoryManager(), pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->createBindlessHeapsHelper(pDevice->getMemoryManager(),
pDevice->getNumGenericSubDevices() > 1, pDevice->getNumGenericSubDevices() > 1,
pDevice->getRootDeviceIndex(), pDevice->getRootDeviceIndex(),
@@ -1353,7 +1353,7 @@ HWTEST_F(BindlessCommandEncodeStatesContainerTest, givenBindfulKernelWhenBindles
auto commandContainer = std::make_unique<CommandContainer>(); auto commandContainer = std::make_unique<CommandContainer>();
commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
commandContainer->setDirtyStateForAllHeaps(false); commandContainer->setDirtyStateForAllHeaps(false);
commandContainer->l1CachePolicyData = &l1CachePolicyData; commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->createBindlessHeapsHelper(pDevice->getMemoryManager(), pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->createBindlessHeapsHelper(pDevice->getMemoryManager(),
pDevice->getNumGenericSubDevices() > 1, pDevice->getNumGenericSubDevices() > 1,
pDevice->getRootDeviceIndex(), pDevice->getRootDeviceIndex(),
@@ -1390,7 +1390,7 @@ HWTEST_F(BindlessCommandEncodeStatesContainerTest, givenBindlessModeEnabledWhenD
auto commandContainer = std::make_unique<CommandContainer>(); auto commandContainer = std::make_unique<CommandContainer>();
commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
commandContainer->setDirtyStateForAllHeaps(false); commandContainer->setDirtyStateForAllHeaps(false);
commandContainer->l1CachePolicyData = &l1CachePolicyData; commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->createBindlessHeapsHelper(pDevice->getMemoryManager(), pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->createBindlessHeapsHelper(pDevice->getMemoryManager(),
pDevice->getNumGenericSubDevices() > 1, pDevice->getNumGenericSubDevices() > 1,
pDevice->getRootDeviceIndex(), pDevice->getRootDeviceIndex(),

View File

@@ -396,9 +396,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenCleanHeapsWhenDispatc
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
uint32_t dims[] = {2, 1, 1}; uint32_t dims[] = {2, 1, 1};
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder()); std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
cmdContainer->slmSize = 1; cmdContainer->slmSizeRef() = 1;
cmdContainer->setDirtyStateForAllHeaps(false); cmdContainer->setDirtyStateForAllHeaps(false);
dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSize; dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSizeRef();
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
@@ -439,7 +439,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeD
DebugManager.flags.ForceBtpPrefetchMode.set(-1); DebugManager.flags.ForceBtpPrefetchMode.set(-1);
cmdContainer.reset(new MyMockCommandContainer()); cmdContainer.reset(new MyMockCommandContainer());
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
cmdContainer->l1CachePolicyData = &l1CachePolicyData; cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
@@ -473,7 +473,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeD
DebugManager.flags.ForceBtpPrefetchMode.set(0); DebugManager.flags.ForceBtpPrefetchMode.set(0);
cmdContainer.reset(new MyMockCommandContainer()); cmdContainer.reset(new MyMockCommandContainer());
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
cmdContainer->l1CachePolicyData = &l1CachePolicyData; cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
@@ -498,7 +498,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeD
DebugManager.flags.ForceBtpPrefetchMode.set(1); DebugManager.flags.ForceBtpPrefetchMode.set(1);
cmdContainer.reset(new MyMockCommandContainer()); cmdContainer.reset(new MyMockCommandContainer());
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
cmdContainer->l1CachePolicyData = &l1CachePolicyData; cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
@@ -1371,7 +1371,7 @@ HWTEST2_F(CommandEncodeStatesTest,
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder()); std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
bool dpasModeRequired = true; bool dpasModeRequired = true;
cmdContainer->lastPipelineSelectModeRequired = false; cmdContainer->lastPipelineSelectModeRequiredRef() = false;
dispatchInterface->kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode = dpasModeRequired; dispatchInterface->kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode = dpasModeRequired;
@@ -1402,7 +1402,7 @@ HWTEST2_F(CommandEncodeStatesTest,
bool dpasModeRequired = true; bool dpasModeRequired = true;
DebugManager.flags.OverrideSystolicPipelineSelect.set(!dpasModeRequired); DebugManager.flags.OverrideSystolicPipelineSelect.set(!dpasModeRequired);
cmdContainer->lastPipelineSelectModeRequired = false; cmdContainer->lastPipelineSelectModeRequiredRef() = false;
dispatchInterface->kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode = dpasModeRequired; dispatchInterface->kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode = dpasModeRequired;
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
@@ -1429,7 +1429,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest,
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder()); std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
bool dpasModeRequired = true; bool dpasModeRequired = true;
cmdContainer->lastPipelineSelectModeRequired = dpasModeRequired; cmdContainer->lastPipelineSelectModeRequiredRef() = dpasModeRequired;
dispatchInterface->kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode = dpasModeRequired; dispatchInterface->kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode = dpasModeRequired;
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;

View File

@@ -20,10 +20,10 @@ void CommandEncodeStatesFixture::setUp() {
cmdContainer->setDirtyStateForAllHeaps(false); cmdContainer->setDirtyStateForAllHeaps(false);
const auto &hwInfo = pDevice->getHardwareInfo(); const auto &hwInfo = pDevice->getHardwareInfo();
auto &productHelper = pDevice->getProductHelper(); auto &productHelper = pDevice->getProductHelper();
cmdContainer->systolicModeSupport = productHelper.isSystolicModeConfigurable(hwInfo); cmdContainer->systolicModeSupportRef() = productHelper.isSystolicModeConfigurable(hwInfo);
cmdContainer->doubleSbaWa = productHelper.isAdditionalStateBaseAddressWARequired(hwInfo); cmdContainer->doubleSbaWaRef() = productHelper.isAdditionalStateBaseAddressWARequired(hwInfo);
this->l1CachePolicyData.init(productHelper); this->l1CachePolicyData.init(productHelper);
cmdContainer->l1CachePolicyData = &this->l1CachePolicyData; cmdContainer->l1CachePolicyDataRef() = &this->l1CachePolicyData;
} }
void CommandEncodeStatesFixture::tearDown() { void CommandEncodeStatesFixture::tearDown() {

View File

@@ -52,7 +52,7 @@ class CommandEncodeStatesFixture : public DeviceFixture {
false, // useGlobalAtomics false, // useGlobalAtomics
false, // multiOsContextCapable false, // multiOsContextCapable
false, // isRcs false, // isRcs
container->doubleSbaWa}; // doubleSbaWa container->doubleSbaWaRef()}; // doubleSbaWa
return args; return args;
} }

View File

@@ -40,7 +40,7 @@ void BindlessCommandEncodeStatesFixture::setUp() {
this->l1CachePolicyData.init(productHelper); this->l1CachePolicyData.init(productHelper);
cmdContainer = std::make_unique<CommandContainer>(); cmdContainer = std::make_unique<CommandContainer>();
cmdContainer->l1CachePolicyData = &l1CachePolicyData; cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
} }
void BindlessCommandEncodeStatesFixture::tearDown() { void BindlessCommandEncodeStatesFixture::tearDown() {

View File

@@ -170,7 +170,7 @@ GEN12LPTEST_F(CommandEncodeStatesTest, givenGen12LpPlatformWhenAdjustPipelineSel
auto &cmdStream = *cmdContainer->getCommandStream(); auto &cmdStream = *cmdContainer->getCommandStream();
cmdContainer->systolicModeSupport = false; cmdContainer->systolicModeSupportRef() = false;
descriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode = true; descriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode = true;
auto sizeUsed = cmdStream.getUsed(); auto sizeUsed = cmdStream.getUsed();
void *ptr = ptrOffset(cmdStream.getCpuBase(), (barrierSize + sizeUsed)); void *ptr = ptrOffset(cmdStream.getCpuBase(), (barrierSize + sizeUsed));
@@ -186,7 +186,7 @@ GEN12LPTEST_F(CommandEncodeStatesTest, givenGen12LpPlatformWhenAdjustPipelineSel
EXPECT_EQ(true, pipelineSelectCmd->getMediaSamplerDopClockGateEnable()); EXPECT_EQ(true, pipelineSelectCmd->getMediaSamplerDopClockGateEnable());
EXPECT_EQ(false, pipelineSelectCmd->getSpecialModeEnable()); EXPECT_EQ(false, pipelineSelectCmd->getSpecialModeEnable());
cmdContainer->systolicModeSupport = true; cmdContainer->systolicModeSupportRef() = true;
sizeUsed = cmdStream.getUsed(); sizeUsed = cmdStream.getUsed();
ptr = ptrOffset(cmdStream.getCpuBase(), (barrierSize + sizeUsed)); ptr = ptrOffset(cmdStream.getCpuBase(), (barrierSize + sizeUsed));

View File

@@ -84,14 +84,14 @@ PVCTEST_F(EncodeKernelPvcTest, givenRevisionBAndAboveWhenSpecialModeRequiredThen
for (const auto &deviceId : pvcXlDeviceIds) { for (const auto &deviceId : pvcXlDeviceIds) {
hwInfo->platform.usDeviceID = deviceId; hwInfo->platform.usDeviceID = deviceId;
hwInfo->platform.usRevId = testInput.revId; hwInfo->platform.usRevId = testInput.revId;
cmdContainer->systolicModeSupport = productHelper.isSystolicModeConfigurable(*hwInfo); cmdContainer->systolicModeSupportRef() = productHelper.isSystolicModeConfigurable(*hwInfo);
cmdContainer->lastPipelineSelectModeRequired = false; cmdContainer->lastPipelineSelectModeRequiredRef() = false;
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
dispatchArgs.preemptionMode = NEO::PreemptionMode::Initial; dispatchArgs.preemptionMode = NEO::PreemptionMode::Initial;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dispatchArgs, nullptr); EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dispatchArgs, nullptr);
EXPECT_EQ(testInput.expectedValue, cmdContainer->lastPipelineSelectModeRequired); EXPECT_EQ(testInput.expectedValue, cmdContainer->lastPipelineSelectModeRequiredRef());
} }
} }
} }
@@ -119,7 +119,7 @@ PVCTEST_F(EncodeKernelPvcTest, givenRevisionBAndAboveWhenSpecialModeRequiredAndA
for (const auto &deviceId : pvcXlDeviceIds) { for (const auto &deviceId : pvcXlDeviceIds) {
hwInfo->platform.usDeviceID = deviceId; hwInfo->platform.usDeviceID = deviceId;
hwInfo->platform.usRevId = testInput.revId; hwInfo->platform.usRevId = testInput.revId;
cmdContainer->systolicModeSupport = productHelper.isSystolicModeConfigurable(*hwInfo); cmdContainer->systolicModeSupportRef() = productHelper.isSystolicModeConfigurable(*hwInfo);
EncodeComputeMode<FamilyType>::adjustPipelineSelect(*cmdContainer.get(), dispatchInterface->kernelDescriptor); EncodeComputeMode<FamilyType>::adjustPipelineSelect(*cmdContainer.get(), dispatchInterface->kernelDescriptor);
GenCmdList commands; GenCmdList commands;
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());

View File

@@ -503,9 +503,9 @@ XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenDefaultSettingForFenceWhenKern
XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenCleanHeapsAndSlmNotChangedAndUncachedMocsRequestedThenSBAIsProgrammedAndMocsAreSet) { XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenCleanHeapsAndSlmNotChangedAndUncachedMocsRequestedThenSBAIsProgrammedAndMocsAreSet) {
uint32_t dims[] = {2, 1, 1}; uint32_t dims[] = {2, 1, 1};
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder()); std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
cmdContainer->slmSize = 1; cmdContainer->slmSizeRef() = 1;
cmdContainer->setDirtyStateForAllHeaps(false); cmdContainer->setDirtyStateForAllHeaps(false);
dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSize; dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSizeRef();
bool requiresUncachedMocs = true; bool requiresUncachedMocs = true;
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);