diff --git a/level_zero/core/source/cmdlist/cmdlist.h b/level_zero/core/source/cmdlist/cmdlist.h index 7dbb59d443..b3d6620e28 100644 --- a/level_zero/core/source/cmdlist/cmdlist.h +++ b/level_zero/core/source/cmdlist/cmdlist.h @@ -400,6 +400,14 @@ struct CommandList : _ze_command_list_handle_t { void registerCsrDcFlushForDcMitigation(NEO::CommandStreamReceiver &csr); + NEO::EngineGroupType getEngineGroupType() const { + return engineGroupType; + } + + bool getLocalDispatchSupport() const { + return localDispatchSupport; + } + protected: NEO::GraphicsAllocation *getAllocationFromHostPtrMap(const void *buffer, uint64_t bufferSize, bool copyOffload); NEO::GraphicsAllocation *getHostPtrAlloc(const void *buffer, uint64_t bufferSize, bool hostCopyAllowed, bool copyOffload); @@ -491,6 +499,7 @@ struct CommandList : _ze_command_list_handle_t { bool requiresDcFlushForDcMitigation = false; bool statelessBuiltinsEnabled = false; bool lastAppendedKernelBindlessMode = false; + bool localDispatchSupport = false; }; using CommandListAllocatorFn = CommandList *(*)(uint32_t); diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index 321d3efa22..587eb6f7f0 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -260,6 +260,7 @@ ze_result_t CommandListCoreFamily::initialize(Device *device, NEO this->defaultPipelinedThreadArbitrationPolicy = NEO::debugManager.flags.OverrideThreadArbitrationPolicy.get(); } this->statelessBuiltinsEnabled = compilerProductHelper.isForceToStatelessRequired(); + this->localDispatchSupport = productHelper.getSupportedLocalDispatchSizes(hwInfo).size() > 0; this->commandContainer.doubleSbaWaRef() = this->doubleSbaWa; this->commandContainer.l1CachePolicyDataRef() = &this->l1CachePolicyData; diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp index 6784a457ef..9fd1887236 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp @@ -122,6 +122,7 @@ TEST_F(CommandListCreate, whenCommandListIsCreatedThenItIsInitialized) { ze_result_t returnValue; std::unique_ptr commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::renderCompute, 0u, returnValue, false)); ASSERT_NE(nullptr, commandList); + EXPECT_EQ(NEO::EngineGroupType::renderCompute, commandList->getEngineGroupType()); ze_device_handle_t hDevice; EXPECT_EQ(device, commandList->getDevice()); @@ -3048,6 +3049,7 @@ HWTEST2_F(CommandListCreate, givenNullEventWhenAppendEventAfterWalkerThenNothing TEST_F(CommandListCreate, givenCreatedCommandListWhenGettingTrackingFlagsThenDefaultValuseIsHwSupported) { auto &rootDeviceEnvironment = device->getNEODevice()->getRootDeviceEnvironment(); + auto &hwInfo = device->getNEODevice()->getHardwareInfo(); auto &l0GfxCoreHelper = rootDeviceEnvironment.getHelper(); auto &productHelper = rootDeviceEnvironment.getHelper(); @@ -3081,6 +3083,7 @@ TEST_F(CommandListCreate, givenCreatedCommandListWhenGettingTrackingFlagsThenDef EXPECT_EQ(commandList->heaplessModeEnabled, commandList->scratchAddressPatchingEnabled); EXPECT_EQ(commandList->statelessBuiltinsEnabled, compilerProductHelper.isForceToStatelessRequired()); + EXPECT_EQ((productHelper.getSupportedLocalDispatchSizes(hwInfo).size() > 0), commandList->getLocalDispatchSupport()); } TEST(BuiltinTypeHelperTest, givenNonStatelessAndNonHeaplessWhenAdjustBuiltinTypeIsCalledThenCorrectBuiltinTypeIsReturned) {