diff --git a/level_zero/core/source/cmdlist/cmdlist.h b/level_zero/core/source/cmdlist/cmdlist.h index dbd5c8642f..af3217c5d7 100644 --- a/level_zero/core/source/cmdlist/cmdlist.h +++ b/level_zero/core/source/cmdlist/cmdlist.h @@ -10,6 +10,7 @@ #include "shared/source/command_container/cmdcontainer.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/command_stream/stream_properties.h" +#include "shared/source/command_stream/thread_arbitration_policy.h" #include "shared/source/helpers/cache_policy.h" #include "shared/source/helpers/common_types.h" #include "shared/source/helpers/definitions/command_encoder_args.h" @@ -432,7 +433,7 @@ struct CommandList : _ze_command_list_handle_t { CommandListType cmdListType = CommandListType::typeRegular; uint32_t partitionCount = 1; uint32_t defaultMocsIndex = 0; - int32_t defaultThreadArbitrationPolicy = 0; + int32_t defaultPipelinedThreadArbitrationPolicy = NEO::ThreadArbitrationPolicy::NotPresent; bool isFlushTaskSubmissionEnabled = false; bool isSyncModeQueue = false; diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index 54750bce15..069b55a1c3 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -248,9 +248,9 @@ ze_result_t CommandListCoreFamily::initialize(Device *device, NEO this->inOrderAtomicSignalingEnabled = gfxCoreHelper.inOrderAtomicSignallingEnabled(rootDeviceEnvironment); this->scratchAddressPatchingEnabled = (this->heaplessModeEnabled && !isImmediateType()); this->copyOperationFenceSupported = isCopyOnly() && productHelper.isDeviceToHostCopySignalingFenceRequired(); - this->defaultThreadArbitrationPolicy = gfxCoreHelper.getDefaultThreadArbitrationPolicy(); + this->defaultPipelinedThreadArbitrationPolicy = gfxCoreHelper.getDefaultThreadArbitrationPolicy(); if (NEO::debugManager.flags.OverrideThreadArbitrationPolicy.get() != -1) { - this->defaultThreadArbitrationPolicy = NEO::debugManager.flags.OverrideThreadArbitrationPolicy.get(); + this->defaultPipelinedThreadArbitrationPolicy = NEO::debugManager.flags.OverrideThreadArbitrationPolicy.get(); } this->commandContainer.doubleSbaWaRef() = this->doubleSbaWa; diff --git a/level_zero/core/source/cmdlist/cmdlist_hw_skl_to_tgllp.inl b/level_zero/core/source/cmdlist/cmdlist_hw_skl_to_tgllp.inl index bbe480aa2f..40f42984ea 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw_skl_to_tgllp.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw_skl_to_tgllp.inl @@ -208,7 +208,7 @@ ze_result_t CommandListCoreFamily::appendLaunchKernelWithParams(K launchParams.additionalSizeParam, // additionalSizeParam 0, // partitionCount launchParams.reserveExtraPayloadSpace, // reserveExtraPayloadSpace - 0, // defaultThreadArbitrationPolicy + NEO::ThreadArbitrationPolicy::NotPresent, // defaultPipelinedThreadArbitrationPolicy launchParams.isIndirect, // isIndirect launchParams.isPredicate, // isPredicate false, // isTimestampEvent diff --git a/level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl b/level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl index 3efd816762..81ebd64f69 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl @@ -335,7 +335,7 @@ ze_result_t CommandListCoreFamily::appendLaunchKernelWithParams(K launchParams.additionalSizeParam, // additionalSizeParam this->partitionCount, // partitionCount launchParams.reserveExtraPayloadSpace, // reserveExtraPayloadSpace - this->defaultThreadArbitrationPolicy, // defaultThreadArbitrationPolicy + this->defaultPipelinedThreadArbitrationPolicy, // defaultPipelinedThreadArbitrationPolicy launchParams.isIndirect, // isIndirect launchParams.isPredicate, // isPredicate isTimestampEvent, // isTimestampEvent diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp index 00229acde4..3bb2458a7a 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp @@ -203,7 +203,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenNotEnoughSpaceInCommandStreamWhenA NEO::additionalKernelLaunchSizeParamNotSet, // additionalSizeParam 0, // partitionCount 0, // reserveExtraPayloadSpace - 0, // defaultThreadArbitrationPolicy + NEO::ThreadArbitrationPolicy::NotPresent, // defaultPipelinedThreadArbitrationPolicy false, // isIndirect false, // isPredicate false, // isTimestampEvent diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp index b6cd95935f..6d5062c2d5 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp @@ -700,7 +700,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenNotEnoughSpaceInCommandStreamWhenA NEO::additionalKernelLaunchSizeParamNotSet, // additionalSizeParam 0, // partitionCount 0, // reserveExtraPayloadSpace - 0, // defaultThreadArbitrationPolicy + NEO::ThreadArbitrationPolicy::NotPresent, // defaultPipelinedThreadArbitrationPolicy false, // isIndirect false, // isPredicate false, // isTimestampEvent diff --git a/shared/source/command_container/command_encoder.h b/shared/source/command_container/command_encoder.h index fefd5afeea..ab2b96ca8d 100644 --- a/shared/source/command_container/command_encoder.h +++ b/shared/source/command_container/command_encoder.h @@ -10,6 +10,7 @@ #include "shared/source/command_container/cmdcontainer.h" #include "shared/source/command_container/encode_alu_helper.h" #include "shared/source/command_stream/preemption_mode.h" +#include "shared/source/command_stream/thread_arbitration_policy.h" #include "shared/source/debugger/debugger.h" #include "shared/source/helpers/definitions/command_encoder_args.h" #include "shared/source/helpers/register_offsets.h" @@ -62,7 +63,7 @@ struct EncodeDispatchKernelArgs { uint32_t additionalSizeParam = NEO::additionalKernelLaunchSizeParamNotSet; uint32_t partitionCount = 0u; uint32_t reserveExtraPayloadSpace = 0; - int32_t defaultThreadArbitrationPolicy = 0; + int32_t defaultPipelinedThreadArbitrationPolicy = NEO::ThreadArbitrationPolicy::NotPresent; bool isIndirect = false; bool isPredicate = false; bool isTimestampEvent = false; @@ -127,7 +128,7 @@ struct EncodeDispatchKernel { const uint32_t threadsPerThreadGroup, uint32_t slmTotalSize, SlmPolicy slmPolicy); template - static void encodeEuSchedulingPolicy(InterfaceDescriptorType *pInterfaceDescriptor, const KernelDescriptor &kernelDesc, int32_t defaultThreadArbitrationPolicy); + static void encodeEuSchedulingPolicy(InterfaceDescriptorType *pInterfaceDescriptor, const KernelDescriptor &kernelDesc, int32_t defaultPipelinedThreadArbitrationPolicy); template static void encodeThreadData(WalkerType &walkerCmd, diff --git a/shared/source/command_container/command_encoder.inl b/shared/source/command_container/command_encoder.inl index 328446ed18..1cc171e009 100644 --- a/shared/source/command_container/command_encoder.inl +++ b/shared/source/command_container/command_encoder.inl @@ -591,7 +591,7 @@ bool EncodeDispatchKernel::inlineDataProgrammingRequired(const KernelDes template template -void EncodeDispatchKernel::encodeEuSchedulingPolicy(InterfaceDescriptorType *pInterfaceDescriptor, const KernelDescriptor &kernelDesc, int32_t defaultThreadArbitrationPolicy) { +void EncodeDispatchKernel::encodeEuSchedulingPolicy(InterfaceDescriptorType *pInterfaceDescriptor, const KernelDescriptor &kernelDesc, int32_t defaultPipelinedThreadArbitrationPolicy) { } template diff --git a/shared/source/command_container/command_encoder_enablers.inl b/shared/source/command_container/command_encoder_enablers.inl index e847293140..2c40fcea90 100644 --- a/shared/source/command_container/command_encoder_enablers.inl +++ b/shared/source/command_container/command_encoder_enablers.inl @@ -25,7 +25,7 @@ template void NEO::EncodeDispatchKernel::programBarrierEnable::setScratchAddress(uint64_t &scratchAddress, uint32_t requiredScratchSlot0Size, uint32_t requiredScratchSlot1Size, IndirectHeap *ssh, CommandStreamReceiver &csr); template void NEO::EncodeDispatchKernel::setScratchAddress(uint64_t &scratchAddress, uint32_t requiredScratchSlot0Size, uint32_t requiredScratchSlot1Size, IndirectHeap *ssh, CommandStreamReceiver &csr); template void NEO::EncodeDispatchKernel::programInlineDataHeapless(uint8_t *inlineDataPtr, EncodeDispatchKernelArgs &args, CommandContainer &container, uint64_t offsetThreadData); -template void NEO::EncodeDispatchKernel::encodeEuSchedulingPolicy(Family::INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor, const KernelDescriptor &kernelDesc, int32_t defaultThreadArbitrationPolicy); +template void NEO::EncodeDispatchKernel::encodeEuSchedulingPolicy(Family::INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor, const KernelDescriptor &kernelDesc, int32_t defaultPipelinedThreadArbitrationPolicy); template struct NEO::EncodeStates; template struct NEO::EncodeMath; 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 049b29da6f..68a4a8677a 100644 --- a/shared/source/command_container/command_encoder_xehp_and_later.inl +++ b/shared/source/command_container/command_encoder_xehp_and_later.inl @@ -116,7 +116,7 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis hwInfo); if (args.isHeaplessStateInitEnabled) { - EncodeDispatchKernel::encodeEuSchedulingPolicy(&idd, kernelDescriptor, args.defaultThreadArbitrationPolicy); + EncodeDispatchKernel::encodeEuSchedulingPolicy(&idd, kernelDescriptor, args.defaultPipelinedThreadArbitrationPolicy); } auto &gfxCoreHelper = args.device->getGfxCoreHelper(); diff --git a/shared/test/unit_test/command_container/command_encoder_tests.cpp b/shared/test/unit_test/command_container/command_encoder_tests.cpp index 2a8ebc6b05..5fa9afd986 100644 --- a/shared/test/unit_test/command_container/command_encoder_tests.cpp +++ b/shared/test/unit_test/command_container/command_encoder_tests.cpp @@ -689,8 +689,8 @@ HWTEST_F(CommandEncoderTests, givenInterfaceDescriptorWhenEncodeEuSchedulingPoli KernelDescriptor kernelDescriptor; kernelDescriptor.kernelAttributes.threadArbitrationPolicy = ThreadArbitrationPolicy::AgeBased; - int32_t defaultThreadArbitrationPolicy = ThreadArbitrationPolicy::RoundRobin; - EncodeDispatchKernel::encodeEuSchedulingPolicy(&idd, kernelDescriptor, defaultThreadArbitrationPolicy); + int32_t defaultPipelinedThreadArbitrationPolicy = ThreadArbitrationPolicy::RoundRobin; + EncodeDispatchKernel::encodeEuSchedulingPolicy(&idd, kernelDescriptor, defaultPipelinedThreadArbitrationPolicy); constexpr uint32_t iddSizeInDW = 8; for (uint32_t i = 0u; i < iddSizeInDW; i++) { diff --git a/shared/test/unit_test/fixtures/command_container_fixture.cpp b/shared/test/unit_test/fixtures/command_container_fixture.cpp index 653c101288..2101fa35bf 100644 --- a/shared/test/unit_test/fixtures/command_container_fixture.cpp +++ b/shared/test/unit_test/fixtures/command_container_fixture.cpp @@ -57,7 +57,7 @@ EncodeDispatchKernelArgs CommandEncodeStatesFixture::createDefaultDispatchKernel NEO::additionalKernelLaunchSizeParamNotSet, // additionalSizeParam 1, // partitionCount 0, // reserveExtraPayloadSpace - 0, // defaultThreadArbitrationPolicy + NEO::ThreadArbitrationPolicy::NotPresent, // defaultPipelinedThreadArbitrationPolicy false, // isIndirect false, // isPredicate false, // isTimestampEvent