From 9a149b6da5e86ae2a9ca2eef5accccecd81c829d Mon Sep 17 00:00:00 2001 From: Damian Tomczak Date: Tue, 14 Jan 2025 07:18:30 +0000 Subject: [PATCH] refactor: useGlobalHeaps naming unification Related-to: NEO-12737 Signed-off-by: Damian Tomczak --- level_zero/core/source/cmdlist/cmdlist_hw.inl | 9 +++++---- level_zero/core/source/cmdqueue/cmdqueue_hw.inl | 9 +++++---- .../command_stream/command_stream_receiver_hw_base.inl | 9 +++++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index 701cb18622..0380651e5b 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -3321,6 +3321,7 @@ void CommandListCoreFamily::updateStreamPropertiesForRegularComma auto &kernelAttributes = kernel.getKernelDescriptor().kernelAttributes; const auto bindlessHeapsHelper = device->getNEODevice()->getBindlessHeapsHelper(); + const bool useGlobalHeaps = bindlessHeapsHelper != nullptr; KernelImp &kernelImp = static_cast(kernel); @@ -3333,8 +3334,8 @@ void CommandListCoreFamily::updateStreamPropertiesForRegularComma if (currentSurfaceStateBaseAddress == NEO::StreamProperty64::initValue || commandContainer.isHeapDirty(NEO::IndirectHeap::Type::surfaceState)) { auto ssh = commandContainer.getIndirectHeap(NEO::IndirectHeap::Type::surfaceState); if (ssh) { - currentSurfaceStateBaseAddress = NEO::getStateBaseAddressForSsh(*ssh, bindlessHeapsHelper); - currentSurfaceStateSize = NEO::getStateSizeForSsh(*ssh, bindlessHeapsHelper); + currentSurfaceStateBaseAddress = NEO::getStateBaseAddressForSsh(*ssh, useGlobalHeaps); + currentSurfaceStateSize = NEO::getStateSizeForSsh(*ssh, useGlobalHeaps); currentBindingTablePoolBaseAddress = currentSurfaceStateBaseAddress; currentBindingTablePoolSize = currentSurfaceStateSize; @@ -3347,8 +3348,8 @@ void CommandListCoreFamily::updateStreamPropertiesForRegularComma if (this->dynamicHeapRequired && (currentDynamicStateBaseAddress == NEO::StreamProperty64::initValue || commandContainer.isHeapDirty(NEO::IndirectHeap::Type::dynamicState))) { auto dsh = commandContainer.getIndirectHeap(NEO::IndirectHeap::Type::dynamicState); - currentDynamicStateBaseAddress = NEO::getStateBaseAddress(*dsh, bindlessHeapsHelper); - currentDynamicStateSize = NEO::getStateSize(*dsh, bindlessHeapsHelper); + currentDynamicStateBaseAddress = NEO::getStateBaseAddress(*dsh, useGlobalHeaps); + currentDynamicStateSize = NEO::getStateSize(*dsh, useGlobalHeaps); checkDsh = true; } diff --git a/level_zero/core/source/cmdqueue/cmdqueue_hw.inl b/level_zero/core/source/cmdqueue/cmdqueue_hw.inl index 79356b158d..79f17127cf 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue_hw.inl +++ b/level_zero/core/source/cmdqueue/cmdqueue_hw.inl @@ -1654,6 +1654,7 @@ void CommandQueueHw::updateBaseAddressState(CommandList *lastComm auto &streamProperties = this->csr->getStreamProperties(); const auto bindlessHeapsHelper = device->getNEODevice()->getBindlessHeapsHelper(); + const bool useGlobalHeaps = bindlessHeapsHelper != nullptr; auto &commandContainer = lastCommandList->getCmdContainer(); @@ -1664,8 +1665,8 @@ void CommandQueueHw::updateBaseAddressState(CommandList *lastComm } else { auto dsh = commandContainer.getIndirectHeap(NEO::HeapType::dynamicState); if (dsh != nullptr) { - auto stateBaseAddress = NEO::getStateBaseAddress(*dsh, bindlessHeapsHelper); - auto stateSize = NEO::getStateSize(*dsh, bindlessHeapsHelper); + auto stateBaseAddress = NEO::getStateBaseAddress(*dsh, useGlobalHeaps); + auto stateSize = NEO::getStateSize(*dsh, useGlobalHeaps); csrHw->getDshState().updateAndCheck(dsh, stateBaseAddress, stateSize); streamProperties.stateBaseAddress.setPropertiesDynamicState(stateBaseAddress, stateSize); @@ -1673,8 +1674,8 @@ void CommandQueueHw::updateBaseAddressState(CommandList *lastComm auto ssh = commandContainer.getIndirectHeap(NEO::HeapType::surfaceState); if (ssh != nullptr) { - auto stateBaseAddress = NEO::getStateBaseAddressForSsh(*ssh, bindlessHeapsHelper); - auto stateSize = NEO::getStateSizeForSsh(*ssh, bindlessHeapsHelper); + auto stateBaseAddress = NEO::getStateBaseAddressForSsh(*ssh, useGlobalHeaps); + auto stateSize = NEO::getStateSizeForSsh(*ssh, useGlobalHeaps); csrHw->getSshState().updateAndCheck(ssh, stateBaseAddress, stateSize); streamProperties.stateBaseAddress.setPropertiesBindingTableSurfaceState(stateBaseAddress, diff --git a/shared/source/command_stream/command_stream_receiver_hw_base.inl b/shared/source/command_stream/command_stream_receiver_hw_base.inl index ede4bd58cf..b9c73b8b27 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -1575,6 +1575,7 @@ inline void CommandStreamReceiverHw::programStateBaseAddress(const In bool stateBaseAddressDirty) { const auto bindlessHeapsHelper = device.getBindlessHeapsHelper(); + const bool useGlobalHeaps = bindlessHeapsHelper != nullptr; auto &hwInfo = this->peekHwInfo(); @@ -1582,15 +1583,15 @@ inline void CommandStreamReceiverHw::programStateBaseAddress(const In int64_t dynamicStateBaseAddress = 0; size_t dynamicStateSize = 0; if (hasDsh) { - dynamicStateBaseAddress = NEO::getStateBaseAddress(*dsh, bindlessHeapsHelper); + dynamicStateBaseAddress = NEO::getStateBaseAddress(*dsh, useGlobalHeaps); dynamicStateSize = NEO::getStateSize(*dsh, bindlessHeapsHelper); } int64_t surfaceStateBaseAddress = 0; size_t surfaceStateSize = 0; if (ssh != nullptr) { - surfaceStateBaseAddress = NEO::getStateBaseAddressForSsh(*ssh, bindlessHeapsHelper); - surfaceStateSize = NEO::getStateSizeForSsh(*ssh, bindlessHeapsHelper); + surfaceStateBaseAddress = NEO::getStateBaseAddressForSsh(*ssh, useGlobalHeaps); + surfaceStateSize = NEO::getStateSizeForSsh(*ssh, useGlobalHeaps); } bool dshDirty = hasDsh ? dshState.updateAndCheck(dsh, dynamicStateBaseAddress, dynamicStateSize) : false;