diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index 26377a222c..44090f265e 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -164,10 +164,10 @@ ze_result_t CommandListCoreFamily::initialize(Device *device, NEO this->signalAllEventPackets = L0GfxCoreHelper::useSignalAllEventPackets(hwInfo); this->dynamicHeapRequired = NEO::EncodeDispatchKernel::isDshNeeded(device->getDeviceInfo()); 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->l1CachePolicyData.init(productHelper); - this->commandContainer.l1CachePolicyData = &this->l1CachePolicyData; + this->commandContainer.l1CachePolicyDataRef() = &this->l1CachePolicyData; this->cmdListHeapAddressModel = L0GfxCoreHelper::getHeapAddressModel(rootDeviceEnvironment); this->requiredStreamState.initSupport(rootDeviceEnvironment); this->finalStreamState.initSupport(rootDeviceEnvironment); @@ -210,7 +210,7 @@ ze_result_t CommandListCoreFamily::initialize(Device *device, NEO if (!this->pipelineSelectStateTracking) { // allow systolic support set in container when tracking disabled // setting systolic support allows dispatching untracked command in legacy mode - commandContainer.systolicModeSupport = this->systolicModeSupport; + commandContainer.systolicModeSupportRef() = this->systolicModeSupport; } ze_result_t returnType = parseErrorCode(returnValue); @@ -247,7 +247,7 @@ inline ze_result_t CommandListCoreFamily::executeCommandListImmed } if (this->isCopyOnly() && !this->isSyncModeQueue && !this->isTbxMode) { - this->commandContainer.currentLinearStreamStartOffset = this->commandContainer.getCommandStream()->getUsed(); + this->commandContainer.currentLinearStreamStartOffsetRef() = this->commandContainer.getCommandStream()->getUsed(); this->handlePostSubmissionState(); } else { const auto synchronizationResult = cmdQImmediate->synchronize(std::numeric_limits::max()); diff --git a/level_zero/core/source/cmdqueue/cmdqueue_hw.inl b/level_zero/core/source/cmdqueue/cmdqueue_hw.inl index 49fb4c6f2e..990bf48ef4 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue_hw.inl +++ b/level_zero/core/source/cmdqueue/cmdqueue_hw.inl @@ -550,7 +550,7 @@ void CommandQueueHw::setupCmdListsAndContextParams( if (commandContainer.getIndirectHeap(NEO::HeapType::SURFACE_STATE) != nullptr) { heapContainer.push_back(commandContainer.getIndirectHeap(NEO::HeapType::SURFACE_STATE)->getGraphicsAllocation()); } - for (auto &element : commandContainer.sshAllocations) { + for (auto &element : commandContainer.getSshAllocations()) { heapContainer.push_back(element); } } @@ -905,7 +905,7 @@ void CommandQueueHw::programOneCmdListBatchBufferStart(CommandLis auto allocation = cmdBufferAllocations[iter]; uint64_t startOffset = allocation->getGpuAddress(); if (isCommandListImmediate && (iter == (cmdBufferCount - 1))) { - startOffset = ptrOffset(allocation->getGpuAddress(), commandContainer.currentLinearStreamStartOffset); + startOffset = ptrOffset(allocation->getGpuAddress(), commandContainer.currentLinearStreamStartOffsetRef()); } NEO::EncodeBatchBufferStartOrEnd::programBatchBufferStart(&cmdStream, startOffset, true, false, false); if (returnPointsSize > 0) { diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp index 8d01e2cffc..a0f82df833 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp @@ -289,7 +289,7 @@ HWTEST2_F(CommandListCreate, ze_result_t result = ZE_RESULT_SUCCESS; std::unique_ptr commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result)); auto &commandContainer = commandList->getCmdContainer(); - commandContainer.slmSize = 0; + commandContainer.slmSizeRef() = 0; void *srcBuffer = reinterpret_cast(0x1234); void *dstBuffer = reinterpret_cast(0x2345); @@ -346,7 +346,7 @@ HWTEST2_F(CommandListCreate, ze_result_t result = ZE_RESULT_SUCCESS; std::unique_ptr commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result)); auto &commandContainer = commandList->getCmdContainer(); - commandContainer.slmSize = 0; + commandContainer.slmSizeRef() = 0; void *srcBuffer = nullptr; void *dstBuffer = nullptr; @@ -410,7 +410,7 @@ HWTEST2_F(CommandListCreate, ze_result_t result = ZE_RESULT_SUCCESS; std::unique_ptr commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result)); auto &commandContainer = commandList->getCmdContainer(); - commandContainer.slmSize = 0; + commandContainer.slmSizeRef() = 0; void *dstBuffer = nullptr; ze_device_mem_alloc_desc_t deviceDesc = {}; @@ -466,7 +466,7 @@ HWTEST2_F(CommandListCreate, ze_result_t result = ZE_RESULT_SUCCESS; std::unique_ptr commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result)); auto &commandContainer = commandList->getCmdContainer(); - commandContainer.slmSize = 0; + commandContainer.slmSizeRef() = 0; void *dstBuffer = nullptr; ze_device_mem_alloc_desc_t deviceDesc = {}; @@ -523,7 +523,7 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenMemoryFillHavingHostMemoryWithS ze_result_t result = ZE_RESULT_SUCCESS; std::unique_ptr commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result)); auto &commandContainer = commandList->getCmdContainer(); - commandContainer.slmSize = 0; + commandContainer.slmSizeRef() = 0; void *dstBuffer = nullptr; ze_host_mem_alloc_desc_t hostDesc = {}; @@ -578,7 +578,7 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenMemoryFillHavingEventsWithDevic ze_result_t result = ZE_RESULT_SUCCESS; std::unique_ptr commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result)); auto &commandContainer = commandList->getCmdContainer(); - commandContainer.slmSize = 0; + commandContainer.slmSizeRef() = 0; void *dstBuffer = nullptr; ze_host_mem_alloc_desc_t hostDesc = {}; @@ -637,7 +637,7 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenMemoryFillHavingEventsWithDevic ze_result_t result = ZE_RESULT_SUCCESS; std::unique_ptr commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, result)); auto &commandContainer = commandList->getCmdContainer(); - commandContainer.slmSize = 0; + commandContainer.slmSizeRef() = 0; void *dstBuffer = nullptr; ze_host_mem_alloc_desc_t hostDesc = {}; diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp index 82e23f967b..ba3aacb3e5 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp @@ -744,7 +744,7 @@ HWTEST_F(CommandListAppendLaunchKernel, givenCommandListWhenResetCalledThenState ASSERT_EQ(commandListControl->getPrintfKernelContainer().size(), commandList->getPrintfKernelContainer().size()); 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++) { auto heapType = static_cast(i); diff --git a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp index a5328d39fe..92231f797c 100644 --- a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp @@ -1157,8 +1157,8 @@ HWTEST2_F(ExecuteCommandListTests, givenExecuteCommandListWhenItReturnsThenConta 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); - commandList->commandContainer.sshAllocations.push_back(&graphicsAllocation1); - commandList->commandContainer.sshAllocations.push_back(&graphicsAllocation2); + commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation1); + commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation2); 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 graphicsAllocation2(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); - commandList->commandContainer.sshAllocations.push_back(&graphicsAllocation1); - commandList->commandContainer.sshAllocations.push_back(&graphicsAllocation2); + commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation1); + commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation2); 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 graphicsAllocation2(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u); - commandList->commandContainer.sshAllocations.push_back(&graphicsAllocation1); - commandList->commandContainer.sshAllocations.push_back(&graphicsAllocation2); + commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation1); + commandList->commandContainer.getSshAllocations().push_back(&graphicsAllocation2); commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false); diff --git a/shared/source/command_container/cmdcontainer.h b/shared/source/command_container/cmdcontainer.h index 45c147dcd6..2d5b1626b5 100644 --- a/shared/source/command_container/cmdcontainer.h +++ b/shared/source/command_container/cmdcontainer.h @@ -179,15 +179,14 @@ class CommandContainer : public NonCopyableOrMovableClass { stateBaseAddressTracking = value; } - HeapContainer sshAllocations; - uint64_t currentLinearStreamStartOffset = 0u; - uint32_t slmSize = std::numeric_limits::max(); - uint32_t nextIddInBlock = 0; - L1CachePolicy *l1CachePolicyData = nullptr; - bool lastPipelineSelectModeRequired = false; - bool lastSentUseGlobalAtomics = false; - bool systolicModeSupport = false; - bool doubleSbaWa = false; + bool &systolicModeSupportRef() { return systolicModeSupport; } + bool &lastPipelineSelectModeRequiredRef() { return lastPipelineSelectModeRequired; } + L1CachePolicy *&l1CachePolicyDataRef() { return l1CachePolicyData; } + bool &doubleSbaWaRef() { return doubleSbaWa; } + uint32_t &slmSizeRef() { return slmSize; } + uint32_t &nextIddInBlockRef() { return nextIddInBlock; } + HeapContainer &getSshAllocations() { return sshAllocations; } + uint64_t ¤tLinearStreamStartOffsetRef() { return currentLinearStreamStartOffset; } protected: size_t getAlignedCmdBufferSize() const; @@ -202,33 +201,39 @@ class CommandContainer : public NonCopyableOrMovableClass { GraphicsAllocation *allocationIndirectHeaps[HeapType::NUM_TYPES] = {}; std::unique_ptr indirectHeaps[HeapType::NUM_TYPES]; - HeapReserveData dynamicStateHeapReserveData; - HeapReserveData surfaceStateHeapReserveData; CmdBufferContainer cmdBufferAllocations; ResidencyContainer residencyContainer; std::vector deallocationContainer; + HeapContainer sshAllocations; + + HeapReserveData dynamicStateHeapReserveData; + HeapReserveData surfaceStateHeapReserveData; std::unique_ptr heapHelper; std::unique_ptr commandStream; std::unique_ptr secondaryCommandStreamForImmediateCmdList; + std::unique_ptr immediateReusableAllocationList; uint64_t instructionHeapBaseAddress = 0u; uint64_t indirectObjectHeapBaseAddress = 0u; + uint64_t currentLinearStreamStartOffset = 0u; void *iddBlock = nullptr; Device *device = nullptr; AllocationsList *reusableAllocationList = nullptr; - std::unique_ptr immediateReusableAllocationList; size_t reservedSshSize = 0; CommandStreamReceiver *immediateCmdListCsr = nullptr; IndirectHeap *sharedSshCsrHeap = nullptr; IndirectHeap *sharedDshCsrHeap = nullptr; size_t defaultSshSize = 0; + L1CachePolicy *l1CachePolicyData = nullptr; uint32_t dirtyHeaps = std::numeric_limits::max(); uint32_t numIddsPerBlock = 64; HeapAddressModel heapAddressModel = HeapAddressModel::PrivateHeaps; + uint32_t slmSize = std::numeric_limits::max(); + uint32_t nextIddInBlock = 0; bool isFlushTaskUsedForImmediate = false; bool isHandleFenceCompletionRequired = false; @@ -236,6 +241,10 @@ class CommandContainer : public NonCopyableOrMovableClass { bool useSecondaryCommandStream = false; bool indirectHeapInLocalMemory = false; bool stateBaseAddressTracking = false; + bool lastPipelineSelectModeRequired = false; + bool lastSentUseGlobalAtomics = false; + bool systolicModeSupport = false; + bool doubleSbaWa = false; }; } // namespace NEO diff --git a/shared/source/command_container/command_encoder.inl b/shared/source/command_container/command_encoder.inl index fd3eac89c7..f58fb93ab8 100644 --- a/shared/source/command_container/command_encoder.inl +++ b/shared/source/command_container/command_encoder.inl @@ -547,7 +547,7 @@ void EncodeSurfaceState::encodeImplicitScalingParams(const EncodeSurface template void *EncodeDispatchKernel::getInterfaceDescriptor(CommandContainer &container, IndirectHeap *childDsh, uint32_t &iddOffset) { - if (container.nextIddInBlock == container.getNumIddPerBlock()) { + if (container.nextIddInBlockRef() == container.getNumIddPerBlock()) { if (ApiSpecificConfig::getBindlessConfiguration()) { container.getDevice()->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::BindlesHeapType::GLOBAL_DSH)->align(EncodeStates::alignInterfaceDescriptorData); container.setIddBlock(container.getDevice()->getBindlessHeapsHelper()->getSpaceInHeap(sizeof(INTERFACE_DESCRIPTOR_DATA) * container.getNumIddPerBlock(), BindlessHeapsHelper::BindlesHeapType::GLOBAL_DSH)); @@ -563,12 +563,13 @@ void *EncodeDispatchKernel::getInterfaceDescriptor(CommandContainer &con } container.setIddBlock(heapPointer); } - container.nextIddInBlock = 0; + container.nextIddInBlockRef() = 0; } - iddOffset = container.nextIddInBlock; + iddOffset = container.nextIddInBlockRef(); auto interfaceDescriptorData = static_cast(container.getIddBlock()); - return &interfaceDescriptorData[container.nextIddInBlock++]; + container.nextIddInBlockRef()++; + return &interfaceDescriptorData[iddOffset]; } template diff --git a/shared/source/command_container/command_encoder_bdw_and_later.inl b/shared/source/command_container/command_encoder_bdw_and_later.inl index 2f1f008a8f..34dd000b8d 100644 --- a/shared/source/command_container/command_encoder_bdw_and_later.inl +++ b/shared/source/command_container/command_encoder_bdw_and_later.inl @@ -192,7 +192,7 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis auto slmSizeNew = args.dispatchInterface->getSlmTotalSize(); bool dirtyHeaps = container.isAnyHeapDirty(); - bool flush = container.slmSize != slmSizeNew || dirtyHeaps || args.requiresUncachedMocs; + bool flush = container.slmSizeRef() != slmSizeNew || dirtyHeaps || args.requiresUncachedMocs; if (flush) { PipeControlArgs syncArgs; @@ -207,8 +207,8 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis auto gmmHelper = container.getDevice()->getGmmHelper(); uint32_t statelessMocsIndex = 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 l1CachePolicyDebuggerActive = container.l1CachePolicyData->getL1CacheValue(true); + auto l1CachePolicy = container.l1CachePolicyDataRef()->getL1CacheValue(false); + auto l1CachePolicyDebuggerActive = container.l1CachePolicyDataRef()->getL1CacheValue(true); EncodeStateBaseAddressArgs encodeStateBaseAddressArgs = { &container, // container sba, // sbaCmd @@ -219,15 +219,15 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis false, // useGlobalAtomics false, // multiOsContextCapable args.isRcs, // isRcs - container.doubleSbaWa}; // doubleSbaWa + container.doubleSbaWaRef()}; // doubleSbaWa EncodeStateBaseAddress::encode(encodeStateBaseAddressArgs); container.setDirtyStateForAllHeaps(false); args.requiresUncachedMocs = false; } - if (container.slmSize != slmSizeNew) { + if (container.slmSizeRef() != slmSizeNew) { EncodeL3State::encode(container, slmSizeNew != 0u); - container.slmSize = slmSizeNew; + container.slmSizeRef() = slmSizeNew; } } diff --git a/shared/source/command_container/command_encoder_xehp_and_later.inl b/shared/source/command_container/command_encoder_xehp_and_later.inl index 9620e8ffaf..8668044468 100644 --- a/shared/source/command_container/command_encoder_xehp_and_later.inl +++ b/shared/source/command_container/command_encoder_xehp_and_later.inl @@ -66,8 +66,8 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis } bool systolicModeRequired = kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode; - if (container.systolicModeSupport && (container.lastPipelineSelectModeRequired != systolicModeRequired)) { - container.lastPipelineSelectModeRequired = systolicModeRequired; + if (container.systolicModeSupportRef() && (container.lastPipelineSelectModeRequiredRef() != systolicModeRequired)) { + container.lastPipelineSelectModeRequiredRef() = systolicModeRequired; EncodeComputeMode::adjustPipelineSelect(container, kernelDescriptor); } @@ -230,8 +230,8 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis auto gmmHelper = container.getDevice()->getGmmHelper(); uint32_t statelessMocsIndex = 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 l1CachePolicyDebuggerActive = container.l1CachePolicyData->getL1CacheValue(true); + auto l1CachePolicy = container.l1CachePolicyDataRef()->getL1CacheValue(false); + auto l1CachePolicyDebuggerActive = container.l1CachePolicyDataRef()->getL1CacheValue(true); EncodeStateBaseAddressArgs encodeStateBaseAddressArgs = { &container, // container @@ -243,7 +243,7 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis args.useGlobalAtomics, // useGlobalAtomics args.partitionCount > 1, // multiOsContextCapable args.isRcs, // isRcs - container.doubleSbaWa}; // doubleSbaWa + container.doubleSbaWaRef()}; // doubleSbaWa EncodeStateBaseAddress::encode(encodeStateBaseAddressArgs); container.setDirtyStateForAllHeaps(false); } @@ -630,7 +630,7 @@ void EncodeComputeMode::adjustPipelineSelect(CommandContainer &container PipelineSelectArgs pipelineSelectArgs; pipelineSelectArgs.systolicPipelineSelectMode = kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode; - pipelineSelectArgs.systolicPipelineSelectSupport = container.systolicModeSupport; + pipelineSelectArgs.systolicPipelineSelectSupport = container.systolicModeSupportRef(); PreambleHelper::programPipelineSelect(container.getCommandStream(), pipelineSelectArgs, diff --git a/shared/source/gen12lp/command_encoder_gen12lp.cpp b/shared/source/gen12lp/command_encoder_gen12lp.cpp index d42eca98ee..ae3097431c 100644 --- a/shared/source/gen12lp/command_encoder_gen12lp.cpp +++ b/shared/source/gen12lp/command_encoder_gen12lp.cpp @@ -103,7 +103,7 @@ void EncodeComputeMode::adjustPipelineSelect(CommandContainer &container PipelineSelectArgs pipelineSelectArgs; pipelineSelectArgs.systolicPipelineSelectMode = kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode; - pipelineSelectArgs.systolicPipelineSelectSupport = container.systolicModeSupport; + pipelineSelectArgs.systolicPipelineSelectSupport = container.systolicModeSupportRef(); PreambleHelper::programPipelineSelect(container.getCommandStream(), pipelineSelectArgs, diff --git a/shared/test/unit_test/command_container/command_container_tests.cpp b/shared/test/unit_test/command_container/command_container_tests.cpp index 13b0573161..8fbf7898a1 100644 --- a/shared/test/unit_test/command_container/command_container_tests.cpp +++ b/shared/test/unit_test/command_container/command_container_tests.cpp @@ -158,6 +158,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIs EXPECT_NE(cmdContainer.getHeapHelper(), nullptr); EXPECT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u); EXPECT_NE(cmdContainer.getCommandStream(), nullptr); + EXPECT_EQ(0u, cmdContainer.currentLinearStreamStartOffsetRef()); for (uint32_t i = 0; i < HeapType::NUM_TYPES; i++) { auto heapType = static_cast(i); @@ -431,7 +432,7 @@ HWTEST_F(CommandContainerTest, givenNotEnoughSpaceInSSHWhenGettingHeapWithRequir cmdContainer->getHeapWithRequiredSizeAndAlignment(HeapType::SURFACE_STATE, sizeof(RENDER_SURFACE_STATE), 0); EXPECT_EQ(4 * MemoryConstants::pageSize, heap->getUsed()); - EXPECT_EQ(cmdContainer->sshAllocations.size(), 1u); + EXPECT_EQ(cmdContainer->getSshAllocations().size(), 1u); } TEST_F(CommandContainerTest, givenAvailableSpaceWhenGetHeapWithRequiredSizeAndAlignmentCalledThenExistingAllocationIsReturned) { diff --git a/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp b/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp index d1fb1cc900..e025a120db 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp @@ -507,7 +507,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeDe DebugManager.flags.ForceBtpPrefetchMode.set(-1); cmdContainer.reset(new MyMockCommandContainer()); cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); - cmdContainer->l1CachePolicyData = &l1CachePolicyData; + cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData; bool requiresUncachedMocs = false; EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); @@ -540,7 +540,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeDe DebugManager.flags.ForceBtpPrefetchMode.set(0); cmdContainer.reset(new MyMockCommandContainer()); cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); - cmdContainer->l1CachePolicyData = &l1CachePolicyData; + cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData; bool requiresUncachedMocs = false; EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); @@ -568,7 +568,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeDe DebugManager.flags.ForceBtpPrefetchMode.set(1); cmdContainer.reset(new MyMockCommandContainer()); cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); - cmdContainer->l1CachePolicyData = &l1CachePolicyData; + cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData; bool requiresUncachedMocs = false; 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; uint32_t dims[] = {2, 1, 1}; std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); - cmdContainer->slmSize = 1; + cmdContainer->slmSizeRef() = 1; cmdContainer->setDirtyStateForAllHeaps(false); - dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSize; + dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSizeRef(); bool requiresUncachedMocs = false; 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) { uint32_t dims[] = {2, 1, 1}; std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); - cmdContainer->slmSize = 1; + cmdContainer->slmSizeRef() = 1; cmdContainer->setDirtyStateForAllHeaps(false); - dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSize; + dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSizeRef(); bool requiresUncachedMocs = true; 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}; std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); - cmdContainer->slmSize = 1; + cmdContainer->slmSizeRef() = 1; cmdContainer->setDirtyStateForAllHeaps(true); - dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSize; + dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSizeRef(); bool requiresUncachedMocs = false; 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}; std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); - cmdContainer->slmSize = 1; + cmdContainer->slmSizeRef() = 1; cmdContainer->setDirtyStateForAllHeaps(true); - dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSize; + dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSizeRef(); bool requiresUncachedMocs = false; EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); @@ -707,9 +707,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenCleanHeapsAndSlmChange std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); cmdContainer->setDirtyStateForAllHeaps(false); - dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSize + 1; + dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSizeRef() + 1; - auto slmSizeBefore = cmdContainer->slmSize; + auto slmSizeBefore = cmdContainer->slmSizeRef(); bool requiresUncachedMocs = false; EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); @@ -721,7 +721,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenCleanHeapsAndSlmChange auto itorPC = find(commands.begin(), 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) { @@ -734,7 +734,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, giveNextIddInBlockZeroWhenD cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE)->align(EncodeStates::alignInterfaceDescriptorData); cmdContainer->setIddBlock(cmdContainer->getHeapSpaceAllowGrow(HeapType::DYNAMIC_STATE, sizeof(INTERFACE_DESCRIPTOR_DATA) * cmdContainer->getNumIddPerBlock())); - cmdContainer->nextIddInBlock = 0; + cmdContainer->nextIddInBlockRef() = 0; bool requiresUncachedMocs = false; 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::alignInterfaceDescriptorData); 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 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::alignInterfaceDescriptorData); 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}; std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); @@ -1275,7 +1275,7 @@ HWTEST_F(BindlessCommandEncodeStatesContainerTest, givenBindlessKernelAndBindles auto commandContainer = std::make_unique(); commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); commandContainer->setDirtyStateForAllHeaps(false); - commandContainer->l1CachePolicyData = &l1CachePolicyData; + commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData; pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->createBindlessHeapsHelper(pDevice->getMemoryManager(), pDevice->getNumGenericSubDevices() > 1, @@ -1313,7 +1313,7 @@ HWTEST2_F(BindlessCommandEncodeStatesContainerTest, givenBindlessKernelAndBindle auto commandContainer = std::make_unique(); commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); commandContainer->setDirtyStateForAllHeaps(false); - commandContainer->l1CachePolicyData = &l1CachePolicyData; + commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData; pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->createBindlessHeapsHelper(pDevice->getMemoryManager(), pDevice->getNumGenericSubDevices() > 1, pDevice->getRootDeviceIndex(), @@ -1353,7 +1353,7 @@ HWTEST_F(BindlessCommandEncodeStatesContainerTest, givenBindfulKernelWhenBindles auto commandContainer = std::make_unique(); commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); commandContainer->setDirtyStateForAllHeaps(false); - commandContainer->l1CachePolicyData = &l1CachePolicyData; + commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData; pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->createBindlessHeapsHelper(pDevice->getMemoryManager(), pDevice->getNumGenericSubDevices() > 1, pDevice->getRootDeviceIndex(), @@ -1390,7 +1390,7 @@ HWTEST_F(BindlessCommandEncodeStatesContainerTest, givenBindlessModeEnabledWhenD auto commandContainer = std::make_unique(); commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); commandContainer->setDirtyStateForAllHeaps(false); - commandContainer->l1CachePolicyData = &l1CachePolicyData; + commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData; pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->createBindlessHeapsHelper(pDevice->getMemoryManager(), pDevice->getNumGenericSubDevices() > 1, pDevice->getRootDeviceIndex(), diff --git a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp index 91b446955c..b70c3defaf 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp @@ -396,9 +396,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenCleanHeapsWhenDispatc using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; uint32_t dims[] = {2, 1, 1}; std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); - cmdContainer->slmSize = 1; + cmdContainer->slmSizeRef() = 1; cmdContainer->setDirtyStateForAllHeaps(false); - dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSize; + dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSizeRef(); bool requiresUncachedMocs = false; 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); cmdContainer.reset(new MyMockCommandContainer()); cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); - cmdContainer->l1CachePolicyData = &l1CachePolicyData; + cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData; bool requiresUncachedMocs = false; 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); cmdContainer.reset(new MyMockCommandContainer()); cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); - cmdContainer->l1CachePolicyData = &l1CachePolicyData; + cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData; bool requiresUncachedMocs = false; 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); cmdContainer.reset(new MyMockCommandContainer()); cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); - cmdContainer->l1CachePolicyData = &l1CachePolicyData; + cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData; bool requiresUncachedMocs = false; EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); @@ -1371,7 +1371,7 @@ HWTEST2_F(CommandEncodeStatesTest, std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); bool dpasModeRequired = true; - cmdContainer->lastPipelineSelectModeRequired = false; + cmdContainer->lastPipelineSelectModeRequiredRef() = false; dispatchInterface->kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode = dpasModeRequired; @@ -1402,7 +1402,7 @@ HWTEST2_F(CommandEncodeStatesTest, bool dpasModeRequired = true; DebugManager.flags.OverrideSystolicPipelineSelect.set(!dpasModeRequired); - cmdContainer->lastPipelineSelectModeRequired = false; + cmdContainer->lastPipelineSelectModeRequiredRef() = false; dispatchInterface->kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode = dpasModeRequired; bool requiresUncachedMocs = false; @@ -1429,7 +1429,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); bool dpasModeRequired = true; - cmdContainer->lastPipelineSelectModeRequired = dpasModeRequired; + cmdContainer->lastPipelineSelectModeRequiredRef() = dpasModeRequired; dispatchInterface->kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode = dpasModeRequired; bool requiresUncachedMocs = false; diff --git a/shared/test/unit_test/fixtures/command_container_fixture.cpp b/shared/test/unit_test/fixtures/command_container_fixture.cpp index 53bdd8b51a..a14947f84d 100644 --- a/shared/test/unit_test/fixtures/command_container_fixture.cpp +++ b/shared/test/unit_test/fixtures/command_container_fixture.cpp @@ -20,10 +20,10 @@ void CommandEncodeStatesFixture::setUp() { cmdContainer->setDirtyStateForAllHeaps(false); const auto &hwInfo = pDevice->getHardwareInfo(); auto &productHelper = pDevice->getProductHelper(); - cmdContainer->systolicModeSupport = productHelper.isSystolicModeConfigurable(hwInfo); - cmdContainer->doubleSbaWa = productHelper.isAdditionalStateBaseAddressWARequired(hwInfo); + cmdContainer->systolicModeSupportRef() = productHelper.isSystolicModeConfigurable(hwInfo); + cmdContainer->doubleSbaWaRef() = productHelper.isAdditionalStateBaseAddressWARequired(hwInfo); this->l1CachePolicyData.init(productHelper); - cmdContainer->l1CachePolicyData = &this->l1CachePolicyData; + cmdContainer->l1CachePolicyDataRef() = &this->l1CachePolicyData; } void CommandEncodeStatesFixture::tearDown() { diff --git a/shared/test/unit_test/fixtures/command_container_fixture.h b/shared/test/unit_test/fixtures/command_container_fixture.h index 83b93758af..057141430d 100644 --- a/shared/test/unit_test/fixtures/command_container_fixture.h +++ b/shared/test/unit_test/fixtures/command_container_fixture.h @@ -52,7 +52,7 @@ class CommandEncodeStatesFixture : public DeviceFixture { false, // useGlobalAtomics false, // multiOsContextCapable false, // isRcs - container->doubleSbaWa}; // doubleSbaWa + container->doubleSbaWaRef()}; // doubleSbaWa return args; } diff --git a/shared/test/unit_test/fixtures/front_window_fixture.cpp b/shared/test/unit_test/fixtures/front_window_fixture.cpp index 3997f8de93..c6ddc77745 100644 --- a/shared/test/unit_test/fixtures/front_window_fixture.cpp +++ b/shared/test/unit_test/fixtures/front_window_fixture.cpp @@ -40,7 +40,7 @@ void BindlessCommandEncodeStatesFixture::setUp() { this->l1CachePolicyData.init(productHelper); cmdContainer = std::make_unique(); - cmdContainer->l1CachePolicyData = &l1CachePolicyData; + cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData; } void BindlessCommandEncodeStatesFixture::tearDown() { diff --git a/shared/test/unit_test/gen12lp/test_command_encoder_gen12lp.cpp b/shared/test/unit_test/gen12lp/test_command_encoder_gen12lp.cpp index 74c0b9a47d..1b3737920f 100644 --- a/shared/test/unit_test/gen12lp/test_command_encoder_gen12lp.cpp +++ b/shared/test/unit_test/gen12lp/test_command_encoder_gen12lp.cpp @@ -170,7 +170,7 @@ GEN12LPTEST_F(CommandEncodeStatesTest, givenGen12LpPlatformWhenAdjustPipelineSel auto &cmdStream = *cmdContainer->getCommandStream(); - cmdContainer->systolicModeSupport = false; + cmdContainer->systolicModeSupportRef() = false; descriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode = true; auto sizeUsed = cmdStream.getUsed(); void *ptr = ptrOffset(cmdStream.getCpuBase(), (barrierSize + sizeUsed)); @@ -186,7 +186,7 @@ GEN12LPTEST_F(CommandEncodeStatesTest, givenGen12LpPlatformWhenAdjustPipelineSel EXPECT_EQ(true, pipelineSelectCmd->getMediaSamplerDopClockGateEnable()); EXPECT_EQ(false, pipelineSelectCmd->getSpecialModeEnable()); - cmdContainer->systolicModeSupport = true; + cmdContainer->systolicModeSupportRef() = true; sizeUsed = cmdStream.getUsed(); ptr = ptrOffset(cmdStream.getCpuBase(), (barrierSize + sizeUsed)); diff --git a/shared/test/unit_test/xe_hpc_core/pvc/test_encode_dispatch_kernel_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/test_encode_dispatch_kernel_pvc.cpp index bcbeb08ca3..408b62af96 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/test_encode_dispatch_kernel_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/test_encode_dispatch_kernel_pvc.cpp @@ -84,14 +84,14 @@ PVCTEST_F(EncodeKernelPvcTest, givenRevisionBAndAboveWhenSpecialModeRequiredThen for (const auto &deviceId : pvcXlDeviceIds) { hwInfo->platform.usDeviceID = deviceId; hwInfo->platform.usRevId = testInput.revId; - cmdContainer->systolicModeSupport = productHelper.isSystolicModeConfigurable(*hwInfo); - cmdContainer->lastPipelineSelectModeRequired = false; + cmdContainer->systolicModeSupportRef() = productHelper.isSystolicModeConfigurable(*hwInfo); + cmdContainer->lastPipelineSelectModeRequiredRef() = false; EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); dispatchArgs.preemptionMode = NEO::PreemptionMode::Initial; EncodeDispatchKernel::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) { hwInfo->platform.usDeviceID = deviceId; hwInfo->platform.usRevId = testInput.revId; - cmdContainer->systolicModeSupport = productHelper.isSystolicModeConfigurable(*hwInfo); + cmdContainer->systolicModeSupportRef() = productHelper.isSystolicModeConfigurable(*hwInfo); EncodeComputeMode::adjustPipelineSelect(*cmdContainer.get(), dispatchInterface->kernelDescriptor); GenCmdList commands; CmdParse::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); diff --git a/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp b/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp index 86b34722f5..f1077c235c 100644 --- a/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp +++ b/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp @@ -503,9 +503,9 @@ XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenDefaultSettingForFenceWhenKern XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenCleanHeapsAndSlmNotChangedAndUncachedMocsRequestedThenSBAIsProgrammedAndMocsAreSet) { uint32_t dims[] = {2, 1, 1}; std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); - cmdContainer->slmSize = 1; + cmdContainer->slmSizeRef() = 1; cmdContainer->setDirtyStateForAllHeaps(false); - dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSize; + dispatchInterface->getSlmTotalSizeResult = cmdContainer->slmSizeRef(); bool requiresUncachedMocs = true; EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);