diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index acf9d8698a..da52a92e8f 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -3215,7 +3215,7 @@ void CommandListCoreFamily::dispatchPostSyncCommands(const CmdLis if (this->cmdListType == CommandListType::TYPE_IMMEDIATE) { pipeControlArgs.constantCacheInvalidationEnable = this->csr->isDirectSubmissionEnabled(); } else { - pipeControlArgs.constantCacheInvalidationEnable = productHelper.isDirectSubmissionSupported(this->device->getHwInfo()); + pipeControlArgs.constantCacheInvalidationEnable = this->device->getNEODevice()->isAnyDirectSubmissionEnabled(); } } diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_signal_event.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_signal_event.cpp index bc106de9d3..065cd1f4a3 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_signal_event.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_signal_event.cpp @@ -343,8 +343,7 @@ HWTEST2_F(CommandListAppendUsedPacketSignalEvent, EXPECT_TRUE(cmd->getCommandStreamerStallEnable()); EXPECT_EQ(gpuAddress, NEO::UnitTestHelper::getPipeControlPostSyncAddress(*cmd)); EXPECT_EQ(MemorySynchronizationCommands::getDcFlushEnable(true, device->getNEODevice()->getRootDeviceEnvironment()), cmd->getDcFlushEnable()); - auto &productHelper = device->getNEODevice()->getRootDeviceEnvironment().getHelper(); - EXPECT_EQ(productHelper.isDirectSubmissionConstantCacheInvalidationNeeded(device->getHwInfo()) && productHelper.isDirectSubmissionSupported(device->getHwInfo()), cmd->getConstantCacheInvalidationEnable()); + EXPECT_EQ(device->getNEODevice()->isAnyDirectSubmissionEnabled(), cmd->getConstantCacheInvalidationEnable()); EXPECT_TRUE(cmd->getWorkloadPartitionIdOffsetEnable()); postSyncFound++; gpuAddress += event->getSinglePacketSize(); diff --git a/shared/source/device/device.cpp b/shared/source/device/device.cpp index df273b71a6..61ab2d6a80 100644 --- a/shared/source/device/device.cpp +++ b/shared/source/device/device.cpp @@ -875,6 +875,15 @@ void Device::stopDirectSubmission() { } } +bool Device::isAnyDirectSubmissionEnabled() { + bool enabled = false; + for (auto &engine : allEngines) { + auto csr = engine.commandStreamReceiver; + enabled |= csr->isAnyDirectSubmissionEnabled(); + } + return enabled; +} + void Device::allocateRTDispatchGlobals(uint32_t maxBvhLevels) { UNRECOVERABLE_IF(rtDispatchGlobalsInfos.size() < maxBvhLevels + 1); UNRECOVERABLE_IF(rtDispatchGlobalsInfos[maxBvhLevels] != nullptr); diff --git a/shared/source/device/device.h b/shared/source/device/device.h index 672ca85372..6555271c9e 100644 --- a/shared/source/device/device.h +++ b/shared/source/device/device.h @@ -167,6 +167,7 @@ class Device : public ReferenceTrackedObject { uint32_t getNumberOfRegularContextsPerEngine() const { return numberOfRegularContextsPerEngine; } bool isMultiRegularContextSelectionAllowed(aub_stream::EngineType engineType, EngineUsage engineUsage) const; MOCKABLE_VIRTUAL void stopDirectSubmission(); + bool isAnyDirectSubmissionEnabled(); bool isStateSipRequired() const { return getPreemptionMode() == PreemptionMode::MidThread || getDebugger() != nullptr; }