refactor: use common indirectDataAlignment static constexpr value

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2024-02-15 14:15:06 +00:00
committed by Compute-Runtime-Automation
parent cc1732c930
commit 0c5cba8ebd
4 changed files with 11 additions and 17 deletions

View File

@@ -61,11 +61,7 @@ size_t HardwareCommandsHelper<GfxFamily>::sendCrossThreadData(
uint32_t &sizeCrossThreadData,
[[maybe_unused]] uint64_t scratchAddress) {
constexpr bool heaplessModeEnabled = GfxFamily::template isHeaplessMode<WalkerType>();
if constexpr (heaplessModeEnabled == false) {
indirectHeap.align(WalkerType::INDIRECTDATASTARTADDRESS_ALIGN_SIZE);
}
indirectHeap.align(GfxFamily::indirectDataAlignment);
auto offsetCrossThreadData = indirectHeap.getUsed();
char *dest = nullptr;
@@ -120,6 +116,8 @@ size_t HardwareCommandsHelper<GfxFamily>::sendCrossThreadData(
memcpy_s(dest, sizeCrossThreadData, src, sizeCrossThreadData);
}
constexpr bool heaplessModeEnabled = GfxFamily::template isHeaplessMode<WalkerType>();
if constexpr (heaplessModeEnabled) {
auto device = kernel.getContext().getDevice(0);
uint64_t indirectDataAddress = device->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), indirectHeap.getGraphicsAllocation()->isAllocatedInLocalMemoryPool());