From aab3e7f7c521cdc30e6e1465463e834101aa4f3f Mon Sep 17 00:00:00 2001 From: "Dunajski, Bartosz" Date: Thu, 7 Dec 2023 12:52:24 +0000 Subject: [PATCH] refactor: improve getting postsync_data struct type Signed-off-by: Dunajski, Bartosz --- opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl | 5 +++-- .../command_container/command_encoder_xehp_and_later.inl | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl b/opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl index 49b580761e..ffe4a301d4 100644 --- a/opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl +++ b/opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl @@ -102,6 +102,7 @@ void GpgpuWalkerHelper::setupTimestampPacket(LinearStream *cmdStream, WalkerType *walkerCmd, TagNodeBase *timestampPacketNode, const RootDeviceEnvironment &rootDeviceEnvironment) { + using POSTSYNC_DATA = std::remove_reference_t>; const auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo(); auto &postSyncData = walkerCmd->getPostSync(); @@ -113,12 +114,12 @@ void GpgpuWalkerHelper::setupTimestampPacket(LinearStream *cmdStream, EncodeDispatchKernel::template adjustTimestampPacket(*walkerCmd, hwInfo); if (debugManager.flags.UseImmDataWriteModeOnPostSyncOperation.get()) { - postSyncData.setOperation(GfxFamily::POSTSYNC_DATA::OPERATION::OPERATION_WRITE_IMMEDIATE_DATA); + postSyncData.setOperation(POSTSYNC_DATA::OPERATION::OPERATION_WRITE_IMMEDIATE_DATA); auto contextEndAddress = TimestampPacketHelper::getContextEndGpuAddress(*timestampPacketNode); postSyncData.setDestinationAddress(contextEndAddress); postSyncData.setImmediateData(0x2'0000'0002); } else { - postSyncData.setOperation(GfxFamily::POSTSYNC_DATA::OPERATION::OPERATION_WRITE_TIMESTAMP); + postSyncData.setOperation(POSTSYNC_DATA::OPERATION::OPERATION_WRITE_TIMESTAMP); auto contextStartAddress = TimestampPacketHelper::getContextStartGpuAddress(*timestampPacketNode); postSyncData.setDestinationAddress(contextStartAddress); } 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 3c32177479..87306f0f84 100644 --- a/shared/source/command_container/command_encoder_xehp_and_later.inl +++ b/shared/source/command_container/command_encoder_xehp_and_later.inl @@ -31,6 +31,7 @@ #include "shared/source/os_interface/product_helper.h" #include +#include namespace NEO { constexpr size_t timestampDestinationAddressAlignment = 16; @@ -48,6 +49,7 @@ template void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDispatchKernelArgs &args) { using SHARED_LOCAL_MEMORY_SIZE = typename WalkerType::InterfaceDescriptorType::SHARED_LOCAL_MEMORY_SIZE; using STATE_BASE_ADDRESS = typename Family::STATE_BASE_ADDRESS; + using POSTSYNC_DATA = std::remove_reference_t>; constexpr bool heaplessModeEnabled = Family::template isHeaplessMode(); const HardwareInfo &hwInfo = args.device->getHardwareInfo(); @@ -342,7 +344,6 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis requiredWorkgroupOrder, rootDeviceEnvironment); - using POSTSYNC_DATA = typename Family::POSTSYNC_DATA; auto &postSync = walkerCmd.getPostSync(); if (args.eventAddress != 0) { postSync.setDataportPipelineFlush(true);