refactor: get ioh alignment from static function

Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
Maciej Plewka
2024-07-24 11:27:35 +00:00
committed by Compute-Runtime-Automation
parent 1d3d3e9a79
commit afee8814ef
22 changed files with 65 additions and 52 deletions

View File

@@ -200,6 +200,7 @@ struct EncodeDispatchKernel {
return BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE;
}
static size_t getDefaultIOHAlignment();
template <bool isHeapless>
static void setScratchAddress(uint64_t &scratchAddress, uint32_t requiredScratchSlot0Size, uint32_t requiredScratchSlot1Size, IndirectHeap *ssh, CommandStreamReceiver &csr);
template <bool isHeapless>

View File

@@ -0,0 +1,13 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
namespace NEO {
template <typename Family>
size_t EncodeDispatchKernel<Family>::getDefaultIOHAlignment() {
return 1;
}
} // namespace NEO

View File

@@ -6,7 +6,13 @@
*/
namespace NEO {
template <>
void EncodeSurfaceState<Family>::setCoherencyType(Family::RENDER_SURFACE_STATE *surfaceState, Family::RENDER_SURFACE_STATE::COHERENCY_TYPE coherencyType) {
template <typename Family>
size_t EncodeDispatchKernel<Family>::getDefaultIOHAlignment() {
size_t alignment = Family::cacheLineSize;
if (NEO::debugManager.flags.ForceIOHAlignment.get() != -1) {
alignment = static_cast<size_t>(debugManager.flags.ForceIOHAlignment.get());
}
return alignment;
}
} // namespace NEO

View File

@@ -329,7 +329,7 @@ void EncodeDispatchKernel<Family>::encode(CommandContainer &container, EncodeDis
walkerCmd.setIndirectDataStartAddress(static_cast<uint32_t>(offsetThreadData));
walkerCmd.setIndirectDataLength(sizeThreadData);
container.getIndirectHeap(HeapType::indirectObject)->align(rootDeviceEnvironment.getHelper<GfxCoreHelper>().getIOHAlignment());
container.getIndirectHeap(HeapType::indirectObject)->align(NEO::EncodeDispatchKernel<Family>::getDefaultIOHAlignment());
}
EncodeDispatchKernel<Family>::encodeThreadData(walkerCmd,