diff --git a/opencl/source/gen12lp/hardware_commands_helper_gen12lp.cpp b/opencl/source/gen12lp/hardware_commands_helper_gen12lp.cpp index ef32ad5ac7..d41030a006 100644 --- a/opencl/source/gen12lp/hardware_commands_helper_gen12lp.cpp +++ b/opencl/source/gen12lp/hardware_commands_helper_gen12lp.cpp @@ -19,11 +19,12 @@ namespace NEO { using FamilyType = Gen12LpFamily; template -typename HardwareCommandsHelper::INTERFACE_DESCRIPTOR_DATA *HardwareCommandsHelper::getInterfaceDescriptor( +template +InterfaceDescriptorType *HardwareCommandsHelper::getInterfaceDescriptor( const IndirectHeap &indirectHeap, uint64_t offsetInterfaceDescriptor, - INTERFACE_DESCRIPTOR_DATA *inlineInterfaceDescriptor) { - return static_cast(ptrOffset(indirectHeap.getCpuBase(), (size_t)offsetInterfaceDescriptor)); + InterfaceDescriptorType *inlineInterfaceDescriptor) { + return static_cast(ptrOffset(indirectHeap.getCpuBase(), (size_t)offsetInterfaceDescriptor)); } template diff --git a/opencl/source/helpers/enable_hardware_commands_helper_cw.inl b/opencl/source/helpers/enable_hardware_commands_helper_cw.inl index 43f17b6e24..c5374f2ddb 100644 --- a/opencl/source/helpers/enable_hardware_commands_helper_cw.inl +++ b/opencl/source/helpers/enable_hardware_commands_helper_cw.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 Intel Corporation + * Copyright (C) 2024-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -36,7 +36,7 @@ template size_t NEO::HardwareCommandsHelper::sendCrossThreadDat uint64_t scratchAddress, const RootDeviceEnvironment &rootDeviceEnvironment); -template size_t NEO::HardwareCommandsHelper::sendInterfaceDescriptorData( +template size_t NEO::HardwareCommandsHelper::sendInterfaceDescriptorData( const IndirectHeap &indirectHeap, uint64_t offsetInterfaceDescriptor, uint64_t kernelStartOffset, @@ -51,8 +51,8 @@ template size_t NEO::HardwareCommandsHelper::sendInterfaceDescr uint32_t bindingTablePrefetchSize, PreemptionMode preemptionMode, const Device &device, - FamilyType::COMPUTE_WALKER *walkerCmd, - FamilyType::INTERFACE_DESCRIPTOR_DATA *inlineInterfaceDescriptor); + FamilyType::DefaultWalkerType *walkerCmd, + FamilyType::DefaultWalkerType::InterfaceDescriptorType *inlineInterfaceDescriptor); template void NEO::HardwareCommandsHelper::programInlineData( Kernel &kernel, @@ -61,3 +61,9 @@ template void NEO::HardwareCommandsHelper::programInlineData::setInterfaceDescriptorOffset( FamilyType::COMPUTE_WALKER *walkerCmd, uint32_t &interfaceDescriptorIndex); + +template NEO::FamilyType::DefaultWalkerType::InterfaceDescriptorType * +NEO::HardwareCommandsHelper::getInterfaceDescriptor( + const NEO::IndirectHeap &, + uint64_t, + NEO::FamilyType::DefaultWalkerType::InterfaceDescriptorType *); \ No newline at end of file diff --git a/opencl/source/helpers/enable_hardware_commands_helper_gpgpu.inl b/opencl/source/helpers/enable_hardware_commands_helper_gpgpu.inl index f00d55c350..6ba11e37e9 100644 --- a/opencl/source/helpers/enable_hardware_commands_helper_gpgpu.inl +++ b/opencl/source/helpers/enable_hardware_commands_helper_gpgpu.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 Intel Corporation + * Copyright (C) 2024-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -61,3 +61,9 @@ template void NEO::HardwareCommandsHelper::programInlineData::setInterfaceDescriptorOffset( FamilyType::GPGPU_WALKER *walkerCmd, uint32_t &interfaceDescriptorIndex); + +template NEO::FamilyType::DefaultWalkerType::InterfaceDescriptorType * +NEO::HardwareCommandsHelper::getInterfaceDescriptor( + const NEO::IndirectHeap &, + uint64_t, + NEO::FamilyType::DefaultWalkerType::InterfaceDescriptorType *); diff --git a/opencl/source/helpers/hardware_commands_helper.h b/opencl/source/helpers/hardware_commands_helper.h index 3caf4b964e..1b399b6dfb 100644 --- a/opencl/source/helpers/hardware_commands_helper.h +++ b/opencl/source/helpers/hardware_commands_helper.h @@ -43,10 +43,11 @@ struct HardwareCommandsHelper : public HardwareCommandsHelperBase { using MI_ATOMIC = typename GfxFamily::MI_ATOMIC; using COMPARE_OPERATION = typename GfxFamily::MI_SEMAPHORE_WAIT::COMPARE_OPERATION; - static INTERFACE_DESCRIPTOR_DATA *getInterfaceDescriptor( + template + static InterfaceDescryptorType *getInterfaceDescriptor( const IndirectHeap &indirectHeap, uint64_t offsetInterfaceDescriptor, - INTERFACE_DESCRIPTOR_DATA *inlineInterfaceDescriptor); + InterfaceDescryptorType *inlineInterfaceDescriptor); inline static uint32_t additionalSizeRequiredDsh(); diff --git a/opencl/source/helpers/hardware_commands_helper_xehp_and_later.inl b/opencl/source/helpers/hardware_commands_helper_xehp_and_later.inl index 9af7827298..5f82f9735b 100644 --- a/opencl/source/helpers/hardware_commands_helper_xehp_and_later.inl +++ b/opencl/source/helpers/hardware_commands_helper_xehp_and_later.inl @@ -19,10 +19,11 @@ namespace NEO { template -typename HardwareCommandsHelper::INTERFACE_DESCRIPTOR_DATA *HardwareCommandsHelper::getInterfaceDescriptor( +template +InterfaceDescriptorType *HardwareCommandsHelper::getInterfaceDescriptor( const IndirectHeap &indirectHeap, uint64_t offsetInterfaceDescriptor, - INTERFACE_DESCRIPTOR_DATA *inlineInterfaceDescriptor) { + InterfaceDescriptorType *inlineInterfaceDescriptor) { return inlineInterfaceDescriptor; } diff --git a/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp b/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp index b56325de7a..179e6d9bae 100644 --- a/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp @@ -1078,15 +1078,15 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, HardwareCommandsTest, GivenKernelWithSamplersWhen delete[] mockDsh; } -HWTEST2_F(HardwareCommandsTest, givenBindlessKernelWithBufferArgWhenSendIndirectStateThenSurfaceStateIsCopiedToHeapAndCrossThreadDataIsCorrectlyPatched, IsAtLeastXeHpCore) { +HWTEST2_F(HardwareCommandsTest, givenBindlessKernelWithBufferArgWhenSendIndirectStateThenSurfaceStateIsCopiedToHeapAndCrossThreadDataIsCorrectlyPatched, IsHeapfulSupportedAndAtLeastXeHpCore) { - using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using InterfaceDescriptorType = typename DefaultWalkerType::InterfaceDescriptorType; + using WalkerType = typename FamilyType::COMPUTE_WALKER; + using InterfaceDescriptorType = typename WalkerType::InterfaceDescriptorType; CommandQueueHw cmdQ(pContext, pClDevice, 0, false); auto &commandStream = cmdQ.getCS(1024); - auto pWalkerCmd = static_cast(commandStream.getSpace(sizeof(DefaultWalkerType))); + auto pWalkerCmd = static_cast(commandStream.getSpace(sizeof(WalkerType))); // define kernel info std::unique_ptr pKernelInfo = std::make_unique(); @@ -1123,7 +1123,7 @@ HWTEST2_F(HardwareCommandsTest, givenBindlessKernelWithBufferArgWhenSendIndirect auto kernelUsesLocalIds = HardwareCommandsHelper::kernelUsesLocalIds(mockKernel); InterfaceDescriptorType interfaceDescriptorData; - HardwareCommandsHelper::template sendIndirectState( + HardwareCommandsHelper::template sendIndirectState( commandStream, dsh, ioh, diff --git a/shared/source/command_container/command_encoder.h b/shared/source/command_container/command_encoder.h index 79c13bc1de..9ba609de82 100644 --- a/shared/source/command_container/command_encoder.h +++ b/shared/source/command_container/command_encoder.h @@ -198,7 +198,8 @@ struct EncodeDispatchKernelWithHeap { using DefaultWalkerType = typename GfxFamily::DefaultWalkerType; using INTERFACE_DESCRIPTOR_DATA = typename DefaultWalkerType::InterfaceDescriptorType; using BINDING_TABLE_STATE = GfxFamily::BINDING_TABLE_STATE; - static void adjustBindingTablePrefetch(INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor, uint32_t samplerCount, uint32_t bindingTableEntryCount); + template + static void adjustBindingTablePrefetch(InterfaceDescriptorType &interfaceDescriptor, uint32_t samplerCount, uint32_t bindingTableEntryCount); }; template diff --git a/shared/source/command_container/command_encoder.inl b/shared/source/command_container/command_encoder.inl index b9179d8872..aabeb2db76 100644 --- a/shared/source/command_container/command_encoder.inl +++ b/shared/source/command_container/command_encoder.inl @@ -779,14 +779,15 @@ bool EncodeSurfaceState::doBindingTablePrefetch() { } template -void EncodeDispatchKernelWithHeap::adjustBindingTablePrefetch(INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor, uint32_t samplerCount, uint32_t bindingTableEntryCount) { +template +void EncodeDispatchKernelWithHeap::adjustBindingTablePrefetch(InterfaceDescriptorType &interfaceDescriptor, uint32_t samplerCount, uint32_t bindingTableEntryCount) { auto enablePrefetch = EncodeSurfaceState::doBindingTablePrefetch(); if (enablePrefetch) { - interfaceDescriptor.setSamplerCount(static_cast((samplerCount + 3) / 4)); + interfaceDescriptor.setSamplerCount(static_cast((samplerCount + 3) / 4)); interfaceDescriptor.setBindingTableEntryCount(std::min(bindingTableEntryCount, 31u)); } else { - interfaceDescriptor.setSamplerCount(INTERFACE_DESCRIPTOR_DATA::SAMPLER_COUNT::SAMPLER_COUNT_NO_SAMPLERS_USED); + interfaceDescriptor.setSamplerCount(InterfaceDescriptorType::SAMPLER_COUNT::SAMPLER_COUNT_NO_SAMPLERS_USED); interfaceDescriptor.setBindingTableEntryCount(0u); } } diff --git a/shared/source/gen12lp/command_encoder_gen12lp.cpp b/shared/source/gen12lp/command_encoder_gen12lp.cpp index 809a868490..19362fa157 100644 --- a/shared/source/gen12lp/command_encoder_gen12lp.cpp +++ b/shared/source/gen12lp/command_encoder_gen12lp.cpp @@ -808,6 +808,8 @@ template struct EncodeL3State; template void InOrderPatchCommandHelpers::PatchCmd::patchComputeWalker(uint64_t appendCounterValue); template void InOrderPatchCommandHelpers::PatchCmd::patchBlitterCommand(uint64_t appendCounterValue, InOrderPatchCommandHelpers::PatchCmdType patchCmdType); template struct EncodeDispatchKernelWithHeap; +template void NEO::EncodeDispatchKernelWithHeap::adjustBindingTablePrefetch(Family::DefaultWalkerType::InterfaceDescriptorType &, unsigned int, unsigned int); + } // namespace NEO #include "shared/source/command_container/implicit_scaling_before_xe_hp.inl" diff --git a/shared/source/xe2_hpg_core/command_encoder_xe2_hpg_core.cpp b/shared/source/xe2_hpg_core/command_encoder_xe2_hpg_core.cpp index 1746c28b0c..a0dd659a8b 100644 --- a/shared/source/xe2_hpg_core/command_encoder_xe2_hpg_core.cpp +++ b/shared/source/xe2_hpg_core/command_encoder_xe2_hpg_core.cpp @@ -144,4 +144,6 @@ template void InOrderPatchCommandHelpers::PatchCmd::patchComputeWalker(u template void InOrderPatchCommandHelpers::PatchCmd::patchBlitterCommand(uint64_t appendCounterValue, InOrderPatchCommandHelpers::PatchCmdType patchCmdType); template struct EncodeDispatchKernelWithHeap; +template void NEO::EncodeDispatchKernelWithHeap::adjustBindingTablePrefetch(Family::DefaultWalkerType::InterfaceDescriptorType &, unsigned int, unsigned int); + } // namespace NEO diff --git a/shared/source/xe3_core/command_encoder_xe3_core.cpp b/shared/source/xe3_core/command_encoder_xe3_core.cpp index 42c87b4e70..336f7d5cb6 100644 --- a/shared/source/xe3_core/command_encoder_xe3_core.cpp +++ b/shared/source/xe3_core/command_encoder_xe3_core.cpp @@ -175,4 +175,6 @@ namespace NEO { template void InOrderPatchCommandHelpers::PatchCmd::patchComputeWalker(uint64_t appendCounterValue); template void InOrderPatchCommandHelpers::PatchCmd::patchBlitterCommand(uint64_t appendCounterValue, InOrderPatchCommandHelpers::PatchCmdType patchCmdType); template struct EncodeDispatchKernelWithHeap; +template void NEO::EncodeDispatchKernelWithHeap::adjustBindingTablePrefetch(Family::DefaultWalkerType::InterfaceDescriptorType &, unsigned int, unsigned int); + } // namespace NEO diff --git a/shared/source/xe_hpc_core/command_encoder_xe_hpc_core.cpp b/shared/source/xe_hpc_core/command_encoder_xe_hpc_core.cpp index 82a6007b2e..0ad919bf57 100644 --- a/shared/source/xe_hpc_core/command_encoder_xe_hpc_core.cpp +++ b/shared/source/xe_hpc_core/command_encoder_xe_hpc_core.cpp @@ -137,7 +137,8 @@ inline void EncodeMiFlushDW::adjust(MI_FLUSH_DW *miFlushDwCmd, const Pro } template <> -void EncodeDispatchKernelWithHeap::adjustBindingTablePrefetch(INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor, uint32_t samplerCount, uint32_t bindingTableEntryCount) { +template +void EncodeDispatchKernelWithHeap::adjustBindingTablePrefetch(InterfaceDescriptorType &interfaceDescriptor, uint32_t samplerCount, uint32_t bindingTableEntryCount) { auto enablePrefetch = EncodeSurfaceState::doBindingTablePrefetch(); if (enablePrefetch) { @@ -168,4 +169,6 @@ namespace NEO { template void InOrderPatchCommandHelpers::PatchCmd::patchComputeWalker(uint64_t appendCounterValue); template void InOrderPatchCommandHelpers::PatchCmd::patchBlitterCommand(uint64_t appendCounterValue, InOrderPatchCommandHelpers::PatchCmdType patchCmdType); template struct EncodeDispatchKernelWithHeap; +template void NEO::EncodeDispatchKernelWithHeap::adjustBindingTablePrefetch(Family::DefaultWalkerType::InterfaceDescriptorType &, unsigned int, unsigned int); + } // namespace NEO diff --git a/shared/source/xe_hpg_core/command_encoder_xe_hpg_core.cpp b/shared/source/xe_hpg_core/command_encoder_xe_hpg_core.cpp index 426ff86e6d..8f4d280c16 100644 --- a/shared/source/xe_hpg_core/command_encoder_xe_hpg_core.cpp +++ b/shared/source/xe_hpg_core/command_encoder_xe_hpg_core.cpp @@ -191,4 +191,6 @@ template void InOrderPatchCommandHelpers::PatchCmd::patchComputeWalker(u template void InOrderPatchCommandHelpers::PatchCmd::patchBlitterCommand(uint64_t appendCounterValue, InOrderPatchCommandHelpers::PatchCmdType patchCmdType); template void flushGpuCache(LinearStream *commandStream, const Range &ranges, uint64_t postSyncAddress, const HardwareInfo &hwInfo); template struct EncodeDispatchKernelWithHeap; +template void NEO::EncodeDispatchKernelWithHeap::adjustBindingTablePrefetch(Family::DefaultWalkerType::InterfaceDescriptorType &, unsigned int, unsigned int); + } // namespace NEO