From edeb7bdd4bf766ac66a3c000f70ea81895a314aa Mon Sep 17 00:00:00 2001 From: Slawomir Milczarek Date: Tue, 1 Oct 2024 12:41:04 +0000 Subject: [PATCH] refactor: Allocate copy source for work partition allocation on heap No perforamce impact expected since it is initialized once only, but has the advantage of using custom allocator by overriding malloc. Related-To: NEO-12846 Signed-off-by: Slawomir Milczarek --- shared/source/command_stream/command_stream_receiver.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shared/source/command_stream/command_stream_receiver.cpp b/shared/source/command_stream/command_stream_receiver.cpp index 2728434e89..4b6e6e39be 100644 --- a/shared/source/command_stream/command_stream_receiver.cpp +++ b/shared/source/command_stream/command_stream_receiver.cpp @@ -46,6 +46,7 @@ #include "shared/source/utilities/tag_allocator.h" #include "shared/source/utilities/wait_util.h" +#include #include namespace AubMemDump { @@ -864,15 +865,16 @@ bool CommandStreamReceiver::createWorkPartitionAllocation(const Device &device) } uint32_t logicalId = 0; + auto copySrc = std::make_unique>(); for (uint32_t deviceIndex = 0; deviceIndex < deviceBitfield.size(); deviceIndex++) { if (!deviceBitfield.test(deviceIndex)) { continue; } - const uint32_t copySrc[2] = {logicalId++, deviceIndex}; + *copySrc = {logicalId++, deviceIndex}; DeviceBitfield copyBitfield{}; copyBitfield.set(deviceIndex); - auto copySuccess = MemoryTransferHelper::transferMemoryToAllocationBanks(device, workPartitionAllocation, 0, copySrc, sizeof(copySrc), copyBitfield); + auto copySuccess = MemoryTransferHelper::transferMemoryToAllocationBanks(device, workPartitionAllocation, 0, copySrc.get(), 2 * sizeof(uint32_t), copyBitfield); if (!copySuccess) { return false;