From 1cd00b5b89e8146cc85eabb3d8440210aa400c3a Mon Sep 17 00:00:00 2001 From: Maciej Plewka Date: Wed, 24 Jul 2024 15:50:00 +0000 Subject: [PATCH] fix: use per product cache line size to align heaps Signed-off-by: Maciej Plewka --- .../sources/cmdlist/test_cmdlist_5.cpp | 2 +- .../test_cmdlist_append_launch_kernel_1.cpp | 43 ++++++++++++++++++- .../command_queue/hardware_interface_base.inl | 2 +- .../helpers/hardware_commands_helper_base.inl | 5 +-- ...hardware_commands_helper_bdw_and_later.inl | 2 +- ...ardware_commands_helper_xehp_and_later.inl | 2 +- .../hardware_commands_helper_tests.cpp | 2 +- .../command_container/command_encoder.h | 3 +- .../command_container/command_encoder.inl | 8 ++-- .../command_encoder_bdw_and_later.inl | 6 +-- .../command_encoder_xehp_and_later.inl | 10 +++-- shared/source/xe_hpc_core/hw_cmds_pvc.h | 1 - .../xe_hpc_core/hw_cmds_xe_hpc_core_base.h | 1 + .../encoders/test_encode_dispatch_kernel.cpp | 7 +-- ..._encode_dispatch_kernel_xehp_and_later.cpp | 4 +- 15 files changed, 71 insertions(+), 27 deletions(-) diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp index 7cd365dca4..5a558a0283 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp @@ -3001,7 +3001,7 @@ HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest, EXPECT_TRUE(sbaCmd->getSurfaceStateBaseAddressModifyEnable()); EXPECT_EQ(firstHeapSurfaceBaseAddress, sbaCmd->getSurfaceStateBaseAddress()); - ssh->getSpace(ssh->getAvailableSpace() - 128); + ssh->getSpace(ssh->getAvailableSpace() - (2 * FamilyType::cacheLineSize)); result = commandList->reset(); EXPECT_EQ(ZE_RESULT_SUCCESS, result); 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 d2e10b2e4b..6f39800280 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 @@ -6,8 +6,10 @@ */ #include "shared/source/command_container/command_encoder.h" +#include "shared/source/helpers/aligned_memory.h" #include "shared/source/helpers/api_specific_config.h" #include "shared/source/helpers/bindless_heaps_helper.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/helpers/preamble.h" #include "shared/source/helpers/register_offsets.h" @@ -840,7 +842,7 @@ HWTEST_F(CommandListAppendLaunchKernel, WhenAppendingMultipleTimesThenSshIsNotDe std::unique_ptr commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::renderCompute, 0u, returnValue, false)); ze_group_count_t groupCount{1, 1, 1}; - auto kernelSshSize = kernel->getSurfaceStateHeapDataSize(); + auto kernelSshSize = alignUp(kernel->getSurfaceStateHeapDataSize(), FamilyType::cacheLineSize); auto ssh = commandList->getCmdContainer().getIndirectHeap(NEO::HeapType::surfaceState); auto sshHeapSize = ssh->getMaxAvailableSpace(); auto initialAllocation = ssh->getGraphicsAllocation(); @@ -857,6 +859,45 @@ HWTEST_F(CommandListAppendLaunchKernel, WhenAppendingMultipleTimesThenSshIsNotDe EXPECT_NE(initialAllocation, reallocatedAllocation); } +HWTEST_F(CommandListAppendLaunchKernel, WhenAppendingMultipleTimesThenDshIsNotDepletedButReallocated) { + if (!neoDevice->getDeviceInfo().imageSupport) { + GTEST_SKIP(); + } + DebugManagerStateRestore dbgRestorer; + debugManager.flags.UseBindlessMode.set(0); + debugManager.flags.UseExternalAllocatorForSshAndDsh.set(0); + neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->bindlessHeapsHelper.reset(); + + createKernel(); + ze_result_t returnValue; + + std::unique_ptr commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::renderCompute, 0u, returnValue, false)); + ze_group_count_t groupCount{1, 1, 1}; + + size_t size = kernel->getKernelDescriptor().payloadMappings.samplerTable.tableOffset - + kernel->getKernelDescriptor().payloadMappings.samplerTable.borderColor; + + constexpr auto samplerStateSize = sizeof(typename FamilyType::SAMPLER_STATE); + const auto numSamplers = kernel->getKernelDescriptor().payloadMappings.samplerTable.numSamplers; + size += numSamplers * samplerStateSize; + + auto kernelDshSize = alignUp(size, FamilyType::cacheLineSize); + auto dsh = commandList->getCmdContainer().getIndirectHeap(NEO::HeapType::dynamicState); + auto dshHeapSize = dsh->getMaxAvailableSpace(); + auto initialAllocation = dsh->getGraphicsAllocation(); + EXPECT_NE(nullptr, initialAllocation); + const_cast(kernel->getKernelDescriptor().kernelAttributes.bufferAddressingMode) = KernelDescriptor::BindfulAndStateless; + CmdListKernelLaunchParams launchParams = {}; + for (size_t i = 0; i < dshHeapSize / kernelDshSize + 1; i++) { + auto result = commandList->appendLaunchKernel(kernel->toHandle(), groupCount, nullptr, 0, nullptr, launchParams, false); + ASSERT_EQ(ZE_RESULT_SUCCESS, result); + } + + auto reallocatedAllocation = dsh->getGraphicsAllocation(); + EXPECT_NE(nullptr, reallocatedAllocation); + EXPECT_NE(initialAllocation, reallocatedAllocation); +} + using TimestampEventSupport = IsWithinProducts; HWTEST2_F(CommandListAppendLaunchKernel, givenTimestampEventsWhenAppendingKernelThenSRMAndPCEncoded, TimestampEventSupport) { using GPGPU_WALKER = typename FamilyType::GPGPU_WALKER; diff --git a/opencl/source/command_queue/hardware_interface_base.inl b/opencl/source/command_queue/hardware_interface_base.inl index 778150415b..d22a1dd368 100644 --- a/opencl/source/command_queue/hardware_interface_base.inl +++ b/opencl/source/command_queue/hardware_interface_base.inl @@ -119,7 +119,7 @@ void HardwareInterface::dispatchWalker( TimestampPacketHelper::programCsrDependenciesForTimestampPacketContainer(*commandStream, csrDependencies, walkerArgs.relaxedOrderingEnabled, commandQueue.isBcs()); - dsh->align(EncodeStates::alignInterfaceDescriptorData); + dsh->align(NEO::EncodeDispatchKernel::getDefaultDshAlignment()); walkerArgs.interfaceDescriptorIndex = 0; walkerArgs.offsetInterfaceDescriptorTable = dsh->getUsed(); diff --git a/opencl/source/helpers/hardware_commands_helper_base.inl b/opencl/source/helpers/hardware_commands_helper_base.inl index 2b06abe1c0..a87fa7aa22 100644 --- a/opencl/source/helpers/hardware_commands_helper_base.inl +++ b/opencl/source/helpers/hardware_commands_helper_base.inl @@ -81,9 +81,8 @@ size_t HardwareCommandsHelper::getSizeRequiredIOH(const Kernel &kerne template size_t HardwareCommandsHelper::getSizeRequiredSSH(const Kernel &kernel) { - typedef typename GfxFamily::BINDING_TABLE_STATE BINDING_TABLE_STATE; auto sizeSSH = kernel.getSurfaceStateHeapSize(); - sizeSSH += sizeSSH ? BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE : 0; + sizeSSH += sizeSSH ? GfxFamily::cacheLineSize : 0; return sizeSSH; } @@ -255,7 +254,7 @@ size_t HardwareCommandsHelper::sendIndirectState( if constexpr (heaplessModeEnabled == false) { - ssh.align(BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE); + ssh.align(GfxFamily::cacheLineSize); dstBindingTablePointer = HardwareCommandsHelper::checkForAdditionalBTAndSetBTPointer(ssh, kernel); const auto &kernelInfo = kernel.getKernelInfo(); diff --git a/opencl/source/helpers/hardware_commands_helper_bdw_and_later.inl b/opencl/source/helpers/hardware_commands_helper_bdw_and_later.inl index 6ddde7c420..4aa24161de 100644 --- a/opencl/source/helpers/hardware_commands_helper_bdw_and_later.inl +++ b/opencl/source/helpers/hardware_commands_helper_bdw_and_later.inl @@ -80,7 +80,7 @@ size_t HardwareCommandsHelper::sendCrossThreadData( uint32_t &sizeCrossThreadData, uint64_t scratchAddress, const RootDeviceEnvironment &rootDeviceEnvironment) { - indirectHeap.align(WalkerType::INDIRECTDATASTARTADDRESS_ALIGN_SIZE); + indirectHeap.align(GfxFamily::cacheLineSize); auto pImplicitArgs = kernel.getImplicitArgs(); if (pImplicitArgs) { diff --git a/opencl/source/helpers/hardware_commands_helper_xehp_and_later.inl b/opencl/source/helpers/hardware_commands_helper_xehp_and_later.inl index fb0f168a26..6953bd565c 100644 --- a/opencl/source/helpers/hardware_commands_helper_xehp_and_later.inl +++ b/opencl/source/helpers/hardware_commands_helper_xehp_and_later.inl @@ -62,7 +62,7 @@ size_t HardwareCommandsHelper::sendCrossThreadData( [[maybe_unused]] uint64_t scratchAddress, const RootDeviceEnvironment &rootDeviceEnvironment) { - indirectHeap.align(GfxFamily::indirectDataAlignment); + indirectHeap.align(GfxFamily::cacheLineSize); auto offsetCrossThreadData = indirectHeap.getUsed(); char *dest = nullptr; diff --git a/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp b/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp index 1dce9ae61e..c90c19f188 100644 --- a/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp @@ -1442,7 +1442,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, HardwareCommandsTestXeHpAndLater, givenSendCrossThr 0, pClDevice->getRootDeviceEnvironment()); - auto expectedOffsetRelativeToIohBase = 128u; + auto expectedOffsetRelativeToIohBase = alignUp(128u, FamilyType::cacheLineSize); auto iohBaseAddress = is64bit ? 0u : indirectHeap.getHeapGpuBase(); ASSERT_NE(0u, offsetCrossThreadData); diff --git a/shared/source/command_container/command_encoder.h b/shared/source/command_container/command_encoder.h index 86228ae471..7615b350bb 100644 --- a/shared/source/command_container/command_encoder.h +++ b/shared/source/command_container/command_encoder.h @@ -196,8 +196,7 @@ struct EncodeDispatchKernel { static bool isDshNeeded(const DeviceInfo &deviceInfo); static size_t getDefaultDshAlignment(); static constexpr size_t getDefaultSshAlignment() { - using BINDING_TABLE_STATE = typename GfxFamily::BINDING_TABLE_STATE; - return BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE; + return GfxFamily::cacheLineSize; } static size_t getDefaultIOHAlignment(); diff --git a/shared/source/command_container/command_encoder.inl b/shared/source/command_container/command_encoder.inl index e8f523f0b7..f64808a663 100644 --- a/shared/source/command_container/command_encoder.inl +++ b/shared/source/command_container/command_encoder.inl @@ -54,7 +54,7 @@ uint32_t EncodeStates::copySamplerState(IndirectHeap *dsh, SAMPLER_STATE *dstSamplerState = nullptr; uint32_t samplerStateOffsetInDsh = 0; - dsh->align(EncodeStates::alignIndirectStatePointer); + dsh->align(NEO::EncodeDispatchKernel::getDefaultDshAlignment()); uint32_t borderColorOffsetInDsh = 0; if (!bindlessHeapHelper || (!bindlessHeapHelper->isGlobalDshSupported())) { borderColorOffsetInDsh = static_cast(dsh->getUsed()); @@ -561,10 +561,10 @@ void *EncodeDispatchKernel::getInterfaceDescriptor(CommandContainer &con void *heapPointer = nullptr; size_t heapSize = sizeof(INTERFACE_DESCRIPTOR_DATA) * container.getNumIddPerBlock(); if (childDsh != nullptr) { - childDsh->align(EncodeStates::alignInterfaceDescriptorData); + childDsh->align(NEO::EncodeDispatchKernel::getDefaultDshAlignment()); heapPointer = childDsh->getSpace(heapSize); } else { - container.getIndirectHeap(HeapType::dynamicState)->align(EncodeStates::alignInterfaceDescriptorData); + container.getIndirectHeap(HeapType::dynamicState)->align(NEO::EncodeDispatchKernel::getDefaultDshAlignment()); heapPointer = container.getHeapSpaceAllowGrow(HeapType::dynamicState, heapSize); } container.setIddBlock(heapPointer); @@ -903,7 +903,7 @@ size_t EncodeDispatchKernel::getSizeRequiredSsh(const KernelInfo &kernel template size_t EncodeDispatchKernel::getDefaultDshAlignment() { - return EncodeStates::alignIndirectStatePointer; + return Family::cacheLineSize; } 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 37e5d990cb..6947dbb454 100644 --- a/shared/source/command_container/command_encoder_bdw_and_later.inl +++ b/shared/source/command_container/command_encoder_bdw_and_later.inl @@ -108,7 +108,7 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis if (bindingTableStateCount > 0u) { auto ssh = args.surfaceStateHeap; if (ssh == nullptr) { - ssh = container.getHeapWithRequiredSizeAndAlignment(HeapType::surfaceState, args.dispatchInterface->getSurfaceStateHeapDataSize(), BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE); + ssh = container.getHeapWithRequiredSizeAndAlignment(HeapType::surfaceState, args.dispatchInterface->getSurfaceStateHeapDataSize(), NEO::EncodeDispatchKernel::getDefaultSshAlignment()); } bindingTablePointer = static_cast(EncodeSurfaceState::pushBindingTableAndSurfaceStates( *ssh, @@ -124,7 +124,7 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis auto ssh = args.surfaceStateHeap; if (ssh == nullptr) { container.prepareBindfulSsh(); - ssh = container.getHeapWithRequiredSizeAndAlignment(HeapType::surfaceState, sshHeapSize, BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE); + ssh = container.getHeapWithRequiredSizeAndAlignment(HeapType::surfaceState, sshHeapSize, NEO::EncodeDispatchKernel::getDefaultSshAlignment()); } uint64_t bindlessSshBaseOffset = ptrDiff(ssh->getSpace(0), ssh->getCpuBase()); if (globalBindlessSsh) { @@ -182,7 +182,7 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis { auto heapIndirect = container.getIndirectHeap(HeapType::indirectObject); UNRECOVERABLE_IF(!(heapIndirect)); - heapIndirect->align(DefaultWalkerType::INDIRECTDATASTARTADDRESS_ALIGN_SIZE); + heapIndirect->align(Family::cacheLineSize); void *ptr = nullptr; if (args.isKernelDispatchedFromImmediateCmdList) { ptr = container.getHeapWithRequiredSizeAndAlignment(HeapType::indirectObject, iohRequiredSize, DefaultWalkerType::INDIRECTDATASTARTADDRESS_ALIGN_SIZE)->getSpace(iohRequiredSize); 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 f7a4bbc3fc..f23fa9a745 100644 --- a/shared/source/command_container/command_encoder_xehp_and_later.inl +++ b/shared/source/command_container/command_encoder_xehp_and_later.inl @@ -145,7 +145,7 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis auto ssh = args.surfaceStateHeap; if (ssh == nullptr) { container.prepareBindfulSsh(); - ssh = container.getHeapWithRequiredSizeAndAlignment(HeapType::surfaceState, sshHeapSize, BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE); + ssh = container.getHeapWithRequiredSizeAndAlignment(HeapType::surfaceState, sshHeapSize, NEO::EncodeDispatchKernel::getDefaultSshAlignment()); } uint64_t bindlessSshBaseOffset = ptrDiff(ssh->getSpace(0), ssh->getCpuBase()); @@ -169,7 +169,7 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis auto ssh = args.surfaceStateHeap; if (ssh == nullptr) { container.prepareBindfulSsh(); - ssh = container.getHeapWithRequiredSizeAndAlignment(HeapType::surfaceState, args.dispatchInterface->getSurfaceStateHeapDataSize(), BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE); + ssh = container.getHeapWithRequiredSizeAndAlignment(HeapType::surfaceState, args.dispatchInterface->getSurfaceStateHeapDataSize(), NEO::EncodeDispatchKernel::getDefaultSshAlignment()); } auto bindingTablePointer = static_cast(EncodeSurfaceState::pushBindingTableAndSurfaceStates( *ssh, @@ -196,6 +196,10 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis auto dsHeap = args.dynamicStateHeap; if (dsHeap == nullptr) { dsHeap = container.getIndirectHeap(HeapType::dynamicState); + auto dshSizeRequired = NEO::EncodeDispatchKernel::getSizeRequiredDsh(kernelDescriptor, container.getNumIddPerBlock()); + if (dsHeap->getAvailableSpace() <= dshSizeRequired) { + dsHeap = container.getHeapWithRequiredSizeAndAlignment(HeapType::dynamicState, dsHeap->getMaxAvailableSpace(), NEO::EncodeDispatchKernel::getDefaultDshAlignment()); + } } UNRECOVERABLE_IF(!dsHeap); @@ -244,7 +248,7 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis { auto heap = container.getIndirectHeap(HeapType::indirectObject); UNRECOVERABLE_IF(!heap); - heap->align(Family::indirectDataAlignment); + heap->align(Family::cacheLineSize); void *ptr = nullptr; if (args.isKernelDispatchedFromImmediateCmdList) { ptr = container.getHeapWithRequiredSizeAndAlignment(HeapType::indirectObject, iohRequiredSize, Family::indirectDataAlignment)->getSpace(iohRequiredSize); diff --git a/shared/source/xe_hpc_core/hw_cmds_pvc.h b/shared/source/xe_hpc_core/hw_cmds_pvc.h index 09128d603c..6e9c306e30 100644 --- a/shared/source/xe_hpc_core/hw_cmds_pvc.h +++ b/shared/source/xe_hpc_core/hw_cmds_pvc.h @@ -63,7 +63,6 @@ struct PVC : public XeHpcCoreFamily { } static constexpr uint32_t pvcSteppingBits = 0b111; - static constexpr uint32_t cacheLineSize = 0x40; static constexpr bool isDcFlushAllowed = false; }; diff --git a/shared/source/xe_hpc_core/hw_cmds_xe_hpc_core_base.h b/shared/source/xe_hpc_core/hw_cmds_xe_hpc_core_base.h index 63e890cdc4..3cd4685899 100644 --- a/shared/source/xe_hpc_core/hw_cmds_xe_hpc_core_base.h +++ b/shared/source/xe_hpc_core/hw_cmds_xe_hpc_core_base.h @@ -74,6 +74,7 @@ struct XeHpcCore { return bindlessSurfaceOffset << 6; } }; + static constexpr uint32_t cacheLineSize = 0x40; static_assert(sizeof(DataPortBindlessSurfaceExtendedMessageDescriptor) == sizeof(DataPortBindlessSurfaceExtendedMessageDescriptor::packed), ""); }; 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 891bed2f29..b1a3cb0a17 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp @@ -1050,6 +1050,7 @@ HWTEST2_F(EncodeDispatchKernelTest, givenBindlessKernelWithRequiringSshForMisali bool requiresUncachedMocs = false; cmdContainer->getIndirectHeap(HeapType::surfaceState)->getSpace(sizeof(RENDER_SURFACE_STATE)); + cmdContainer->getIndirectHeap(HeapType::surfaceState)->align(FamilyType::cacheLineSize); auto usedBefore = cmdContainer->getIndirectHeap(HeapType::surfaceState)->getUsed(); EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); @@ -1563,7 +1564,7 @@ HWTEST_F(CommandEncodeStatesTest, givenKernelInfoWhenGettingRequiredDshSpaceThen kernelInfo.kernelDescriptor.payloadMappings.samplerTable.tableOffset = 32; // align border color state and samplers - alignedSamplers = alignUp(alignUp(32, EncodeStates::alignIndirectStatePointer) + 3 * sizeof(SAMPLER_STATE), INTERFACE_DESCRIPTOR_DATA::SAMPLERSTATEPOINTER_ALIGN_SIZE); + alignedSamplers = alignUp(alignUp(32, FamilyType::cacheLineSize) + 3 * sizeof(SAMPLER_STATE), INTERFACE_DESCRIPTOR_DATA::SAMPLERSTATEPOINTER_ALIGN_SIZE); // additional IDD for requiring platforms if (additionalSize > 0) { @@ -1586,7 +1587,7 @@ HWTEST_F(CommandEncodeStatesTest, givenKernelInfoWhenGettingRequiredSshSpaceThen // two surface states and BTI indices kernelInfo.heapInfo.surfaceStateHeapSize = 2 * sizeof(RENDER_SURFACE_STATE) + 2 * sizeof(uint32_t); - size_t expectedSize = alignUp(kernelInfo.heapInfo.surfaceStateHeapSize, BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE); + size_t expectedSize = alignUp(kernelInfo.heapInfo.surfaceStateHeapSize, FamilyType::cacheLineSize); size = EncodeDispatchKernel::getSizeRequiredSsh(kernelInfo); EXPECT_EQ(expectedSize, size); @@ -1606,7 +1607,7 @@ HWTEST_F(CommandEncodeStatesTest, givenKernelInfoOfBindlessKernelWhenGettingRequ // two surface states kernelInfo.kernelDescriptor.kernelAttributes.numArgsStateful = 2; - size_t expectedSize = alignUp(2 * sizeof(RENDER_SURFACE_STATE), BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE); + size_t expectedSize = alignUp(2 * sizeof(RENDER_SURFACE_STATE), FamilyType::cacheLineSize); size = EncodeDispatchKernel::getSizeRequiredSsh(kernelInfo); EXPECT_EQ(expectedSize, size); 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 e21b66d328..9ca193c9dc 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 @@ -206,7 +206,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenStatelessBufferAndIma auto ssh = cmdContainer->getIndirectHeap(HeapType::surfaceState); ssh->getSpace(0x20); uint32_t sizeUsed = static_cast(ssh->getUsed()); - auto expectedOffset = alignUp(sizeUsed, BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE); + auto expectedOffset = alignUp(sizeUsed, FamilyType::cacheLineSize); uint32_t dims[] = {2, 1, 1}; std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); @@ -245,7 +245,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givennumBindingTableOneWhe auto ssh = cmdContainer->getIndirectHeap(HeapType::surfaceState); ssh->getSpace(0x20); uint32_t sizeUsed = static_cast(ssh->getUsed()); - auto expectedOffset = alignUp(sizeUsed, BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE); + auto expectedOffset = alignUp(sizeUsed, FamilyType::cacheLineSize); uint32_t dims[] = {2, 1, 1}; std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder());