performance: set 1ms timeout for ulls controller on LNL and PTL

Related-To: NEO-13843

Limit scope to Windows only.

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2025-03-06 07:49:08 +00:00
committed by Compute-Runtime-Automation
parent 320f03f5a6
commit 82fba79d9d
14 changed files with 76 additions and 268 deletions

View File

@@ -450,7 +450,6 @@ DECLARE_DEBUG_VARIABLE(int32_t, EnableDirectSubmissionController, -1, "Enable di
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionControllerTimeout, -1, "Set direct submission controller timeout, -1: default 5000 us, >=0: timeout in us")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionControllerBcsTimeoutDivisor, -1, "If >=1, divide controller timeout to stop BCS only engines faster than others")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionControllerMaxTimeout, -1, "Set direct submission controller max timeout - timeout will increase up to given value, -1: default 5000 us, >=0: max timeout in us")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionControllerDivisor, -1, "Set direct submission controller timeout divider, -1: default 1, >0: divider value")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionControllerAdjustOnThrottleAndAcLineStatus, -1, "Adjust controller timeout settings based on queue throttle and ac line status, -1: default, 0: disabled, 1: enabled")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionForceLocalMemoryStorageMode, -1, "Force local memory storage for command/ring/semaphore buffer, -1: default - for all engines, 0: disabled, 1: for multiOsContextCapable engine, 2: for all engines")
DECLARE_DEBUG_VARIABLE(int32_t, EnableRingSwitchTagUpdateWa, -1, "-1: default, 0 - disable, 1 - enable. If enabled, completionFences wont be updated if ring is not running.")

View File

@@ -25,9 +25,6 @@ DirectSubmissionController::DirectSubmissionController() {
if (debugManager.flags.DirectSubmissionControllerTimeout.get() != -1) {
timeout = std::chrono::microseconds{debugManager.flags.DirectSubmissionControllerTimeout.get()};
}
if (debugManager.flags.DirectSubmissionControllerDivisor.get() != -1) {
timeoutDivisor = debugManager.flags.DirectSubmissionControllerDivisor.get();
}
if (debugManager.flags.DirectSubmissionControllerBcsTimeoutDivisor.get() != -1) {
bcsTimeoutDivisor = debugManager.flags.DirectSubmissionControllerBcsTimeoutDivisor.get();
}
@@ -48,7 +45,7 @@ DirectSubmissionController::~DirectSubmissionController() {
void DirectSubmissionController::registerDirectSubmission(CommandStreamReceiver *csr) {
std::lock_guard<std::mutex> lock(directSubmissionsMutex);
directSubmissions.insert(std::make_pair(csr, DirectSubmissionState()));
this->adjustTimeout(csr);
csr->getProductHelper().overrideDirectSubmissionTimeouts(this->timeout, this->maxTimeout);
}
void DirectSubmissionController::setTimeoutParamsForPlatform(const ProductHelper &helper) {
@@ -217,21 +214,6 @@ SteadyClock::time_point DirectSubmissionController::getCpuTimestamp() {
return SteadyClock::now();
}
void DirectSubmissionController::adjustTimeout(CommandStreamReceiver *csr) {
if (EngineHelpers::isCcs(csr->getOsContext().getEngineType())) {
for (size_t subDeviceIndex = 0u; subDeviceIndex < csr->getOsContext().getDeviceBitfield().size(); ++subDeviceIndex) {
if (csr->getOsContext().getDeviceBitfield().test(subDeviceIndex)) {
++this->ccsCount[subDeviceIndex];
}
}
auto curentMaxCcsCount = std::max_element(this->ccsCount.begin(), this->ccsCount.end());
if (*curentMaxCcsCount > this->maxCcsCount) {
this->maxCcsCount = *curentMaxCcsCount;
this->timeout /= this->timeoutDivisor;
}
}
}
void DirectSubmissionController::recalculateTimeout() {
const auto now = this->getCpuTimestamp();
const auto timeSinceLastTerminate = std::chrono::duration_cast<std::chrono::microseconds>(now - this->lastTerminateCpuTimestamp);

View File

@@ -98,7 +98,6 @@ class DirectSubmissionController {
MOCKABLE_VIRTUAL bool sleep(std::unique_lock<std::mutex> &lock);
MOCKABLE_VIRTUAL SteadyClock::time_point getCpuTimestamp();
void adjustTimeout(CommandStreamReceiver *csr);
void recalculateTimeout();
void applyTimeoutForAcLineStatusAndThrottle(bool acLineConnected);
void updateLastSubmittedThrottle(QueueThrottle throttle);

View File

@@ -11,6 +11,7 @@
#include "aubstream/engine_node.h"
#include <chrono>
#include <igfxfmid.h>
#include <memory>
#include <optional>
@@ -260,6 +261,7 @@ class ProductHelper {
virtual bool isSharingWith3dOrMediaAllowed() const = 0;
virtual bool isL3FlushAfterPostSyncRequired(bool heaplessEnabled) const = 0;
virtual bool isImageSuitableForCompression() const = 0;
virtual void overrideDirectSubmissionTimeouts(std::chrono::microseconds &timeout, std::chrono::microseconds &maxTimeout) const = 0;
virtual ~ProductHelper() = default;

View File

@@ -1018,4 +1018,8 @@ bool ProductHelperHw<gfxProduct>::isImageSuitableForCompression() const {
return true;
}
template <PRODUCT_FAMILY gfxProduct>
void ProductHelperHw<gfxProduct>::overrideDirectSubmissionTimeouts(std::chrono::microseconds &timeout, std::chrono::microseconds &maxTimeout) const {
}
} // namespace NEO

View File

@@ -201,6 +201,7 @@ class ProductHelperHw : public ProductHelper {
bool isSharingWith3dOrMediaAllowed() const override;
bool isL3FlushAfterPostSyncRequired(bool heaplessEnabled) const override;
bool isImageSuitableForCompression() const override;
void overrideDirectSubmissionTimeouts(std::chrono::microseconds &timeout, std::chrono::microseconds &maxTimeout) const override;
~ProductHelperHw() override = default;

View File

@@ -45,11 +45,6 @@ bool ProductHelperHw<gfxProduct>::isCachingOnCpuAvailable() const {
return false;
}
template <>
bool ProductHelperHw<gfxProduct>::isAdjustDirectSubmissionTimeoutOnThrottleAndAcLineStatusEnabled() const {
return true;
}
template <>
TimeoutParams ProductHelperHw<gfxProduct>::getDirectSubmissionControllerTimeoutParams(bool acLineConnected, QueueThrottle queueThrottle) const {
TimeoutParams params{};

View File

@@ -57,5 +57,17 @@ bool ProductHelperHw<gfxProduct>::restartDirectSubmissionForHostptrFree() const
return true;
}
template <>
void ProductHelperHw<gfxProduct>::overrideDirectSubmissionTimeouts(std::chrono::microseconds &timeout, std::chrono::microseconds &maxTimeout) const {
timeout = std::chrono::microseconds{1'000};
maxTimeout = std::chrono::microseconds{1'000};
if (debugManager.flags.DirectSubmissionControllerTimeout.get() != -1) {
timeout = std::chrono::microseconds{debugManager.flags.DirectSubmissionControllerTimeout.get()};
}
if (debugManager.flags.DirectSubmissionControllerMaxTimeout.get() != -1) {
maxTimeout = std::chrono::microseconds{debugManager.flags.DirectSubmissionControllerMaxTimeout.get()};
}
}
template class ProductHelperHw<gfxProduct>;
} // namespace NEO

View File

@@ -28,6 +28,18 @@ bool ProductHelperHw<gfxProduct>::isResolveDependenciesByPipeControlsSupported(c
return enabled;
}
template <>
void ProductHelperHw<gfxProduct>::overrideDirectSubmissionTimeouts(std::chrono::microseconds &timeout, std::chrono::microseconds &maxTimeout) const {
timeout = std::chrono::microseconds{1'000};
maxTimeout = std::chrono::microseconds{1'000};
if (debugManager.flags.DirectSubmissionControllerTimeout.get() != -1) {
timeout = std::chrono::microseconds{debugManager.flags.DirectSubmissionControllerTimeout.get()};
}
if (debugManager.flags.DirectSubmissionControllerMaxTimeout.get() != -1) {
maxTimeout = std::chrono::microseconds{debugManager.flags.DirectSubmissionControllerMaxTimeout.get()};
}
}
template class ProductHelperHw<gfxProduct>;
} // namespace NEO

View File

@@ -125,7 +125,6 @@ DirectSubmissionMaxRingBuffers = -1
USMEvictAfterMigration = 0
EnableDirectSubmissionController = -1
DirectSubmissionControllerTimeout = -1
DirectSubmissionControllerDivisor = -1
DirectSubmissionMonitorFenceInputPolicy = -1
UseVmBind = -1
EnableNullHardware = 0

View File

@@ -8,6 +8,7 @@
#include "shared/source/os_interface/os_context.h"
#include "shared/source/os_interface/os_thread.h"
#include "shared/source/os_interface/os_time.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/engine_descriptor_helper.h"
#include "shared/test/common/mocks/mock_command_stream_receiver.h"
@@ -27,15 +28,6 @@ TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerTimeoutWhen
EXPECT_EQ(controller.timeout.count(), 14);
}
TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllertimeoutDivisorWhenCreateObjectThentimeoutDivisorIsEqualWithDebugFlag) {
DebugManagerStateRestore restorer;
debugManager.flags.DirectSubmissionControllerDivisor.set(4);
DirectSubmissionControllerMock controller;
EXPECT_EQ(controller.timeoutDivisor, 4);
}
TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerWhenRegisterDirectSubmissionWorksThenItIsMonitoringItsState) {
MockExecutionEnvironment executionEnvironment;
executionEnvironment.prepareRootDeviceEnvironments(1);
@@ -166,10 +158,10 @@ TEST(DirectSubmissionControllerTests, givenDebugFlagSetWhenCheckingNewSubmission
controller.unregisterDirectSubmission(&ccsCsr);
}
TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerAndDivisorDisabledWhenIncreaseTimeoutEnabledThenTimeoutIsIncreased) {
TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerWhenIncreaseTimeoutEnabledThenTimeoutIsIncreased) {
DebugManagerStateRestore restorer;
debugManager.flags.DirectSubmissionControllerTimeout.set(5'000);
debugManager.flags.DirectSubmissionControllerMaxTimeout.set(200'000);
debugManager.flags.DirectSubmissionControllerDivisor.set(1);
debugManager.flags.DirectSubmissionControllerAdjustOnThrottleAndAcLineStatus.set(0);
MockExecutionEnvironment executionEnvironment;
executionEnvironment.prepareRootDeviceEnvironments(1);
@@ -290,7 +282,6 @@ TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerAndAdjustOn
TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerAndAdjustOnThrottleAndAcLineStatusEnabledWhenThrottleOrAcLineStatusChangesThenTimeoutIsChanged) {
DebugManagerStateRestore restorer;
debugManager.flags.DirectSubmissionControllerDivisor.set(1);
debugManager.flags.DirectSubmissionControllerAdjustOnThrottleAndAcLineStatus.set(1);
MockExecutionEnvironment executionEnvironment;
executionEnvironment.prepareRootDeviceEnvironments(1);
@@ -403,7 +394,7 @@ TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerAndAdjustOn
controller.unregisterDirectSubmission(&csr);
}
TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerWhenRegisterCsrsThenTimeoutIsNotAdjusted) {
TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerWhenRegisterCsrsThenTimeoutIsAdjusted) {
MockExecutionEnvironment executionEnvironment;
executionEnvironment.prepareRootDeviceEnvironments(1);
executionEnvironment.initializeMemoryManager();
@@ -415,54 +406,12 @@ TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerWhenRegiste
PreemptionMode::ThreadGroup, deviceBitfield)));
csr.setupContext(*osContext.get());
MockCommandStreamReceiver csr1(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext1(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield)));
csr1.setupContext(*osContext1.get());
MockCommandStreamReceiver csr2(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext2(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield)));
csr2.setupContext(*osContext2.get());
MockCommandStreamReceiver csr3(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext3(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield)));
csr3.setupContext(*osContext3.get());
MockCommandStreamReceiver csr4(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext4(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield)));
csr4.setupContext(*osContext4.get());
DirectSubmissionControllerMock controller;
EXPECT_EQ(controller.timeout.count(), 5'000);
auto timeout = std::chrono::microseconds{5'000};
EXPECT_EQ(controller.timeout, timeout);
controller.registerDirectSubmission(&csr);
EXPECT_EQ(controller.timeout.count(), 5'000);
controller.registerDirectSubmission(&csr3);
EXPECT_EQ(controller.timeout.count(), 5'000);
controller.registerDirectSubmission(&csr1);
EXPECT_EQ(controller.timeout.count(), 5'000);
controller.registerDirectSubmission(&csr2);
EXPECT_EQ(controller.timeout.count(), 5'000);
controller.registerDirectSubmission(&csr4);
EXPECT_EQ(controller.timeout.count(), 5'000);
controller.unregisterDirectSubmission(&csr);
controller.unregisterDirectSubmission(&csr1);
controller.unregisterDirectSubmission(&csr2);
controller.unregisterDirectSubmission(&csr3);
controller.unregisterDirectSubmission(&csr4);
csr.getProductHelper().overrideDirectSubmissionTimeouts(timeout, timeout);
EXPECT_EQ(controller.timeout, timeout);
}
TEST(DirectSubmissionControllerTests, givenPowerSavingUintWhenCallingGetThrottleFromPowerSavingUintThenCorrectValueIsReturned) {
@@ -471,187 +420,6 @@ TEST(DirectSubmissionControllerTests, givenPowerSavingUintWhenCallingGetThrottle
EXPECT_EQ(QueueThrottle::LOW, getThrottleFromPowerSavingUint(100u));
}
TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerWhenRegisterCsrsFromDifferentSubdevicesThenTimeoutIsAdjusted) {
DebugManagerStateRestore restorer;
debugManager.flags.DirectSubmissionControllerDivisor.set(4);
MockExecutionEnvironment executionEnvironment;
executionEnvironment.prepareRootDeviceEnvironments(1);
executionEnvironment.initializeMemoryManager();
DeviceBitfield deviceBitfield(1);
DeviceBitfield deviceBitfield1(0b10);
MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield)));
csr.setupContext(*osContext.get());
MockCommandStreamReceiver csr1(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext1(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield)));
csr1.setupContext(*osContext1.get());
MockCommandStreamReceiver csr2(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext2(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield)));
csr2.setupContext(*osContext2.get());
MockCommandStreamReceiver csr3(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext3(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield)));
csr3.setupContext(*osContext3.get());
MockCommandStreamReceiver csr4(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext4(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield)));
csr4.setupContext(*osContext4.get());
MockCommandStreamReceiver csr5(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext5(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield1)));
csr5.setupContext(*osContext5.get());
MockCommandStreamReceiver csr6(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext6(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield1)));
csr6.setupContext(*osContext6.get());
MockCommandStreamReceiver csr7(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext7(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield1)));
csr7.setupContext(*osContext7.get());
MockCommandStreamReceiver csr8(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext8(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield1)));
csr8.setupContext(*osContext8.get());
MockCommandStreamReceiver csr9(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext9(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield1)));
csr9.setupContext(*osContext9.get());
MockCommandStreamReceiver csr10(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext10(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield1)));
csr10.setupContext(*osContext10.get());
DirectSubmissionControllerMock controller;
EXPECT_EQ(controller.timeout.count(), 5'000);
controller.registerDirectSubmission(&csr);
EXPECT_EQ(controller.timeout.count(), 5'000);
controller.registerDirectSubmission(&csr5);
EXPECT_EQ(controller.timeout.count(), 5'000);
controller.registerDirectSubmission(&csr1);
EXPECT_EQ(controller.timeout.count(), 1'250);
controller.registerDirectSubmission(&csr2);
EXPECT_EQ(controller.timeout.count(), 312);
controller.registerDirectSubmission(&csr4);
EXPECT_EQ(controller.timeout.count(), 312);
controller.registerDirectSubmission(&csr6);
EXPECT_EQ(controller.timeout.count(), 312);
controller.registerDirectSubmission(&csr7);
EXPECT_EQ(controller.timeout.count(), 312);
controller.registerDirectSubmission(&csr9);
EXPECT_EQ(controller.timeout.count(), 312);
controller.registerDirectSubmission(&csr8);
EXPECT_EQ(controller.timeout.count(), 78);
controller.registerDirectSubmission(&csr10);
EXPECT_EQ(controller.timeout.count(), 78);
controller.unregisterDirectSubmission(&csr);
controller.unregisterDirectSubmission(&csr1);
controller.unregisterDirectSubmission(&csr2);
controller.unregisterDirectSubmission(&csr3);
controller.unregisterDirectSubmission(&csr4);
}
TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerDirectSubmissionControllerDivisorSetWhenRegisterCsrsThenTimeoutIsAdjusted) {
DebugManagerStateRestore restorer;
debugManager.flags.DirectSubmissionControllerDivisor.set(5);
MockExecutionEnvironment executionEnvironment;
executionEnvironment.prepareRootDeviceEnvironments(1);
executionEnvironment.initializeMemoryManager();
DeviceBitfield deviceBitfield(1);
MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield)));
csr.setupContext(*osContext.get());
MockCommandStreamReceiver csr1(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext1(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield)));
csr1.setupContext(*osContext1.get());
MockCommandStreamReceiver csr2(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext2(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield)));
csr2.setupContext(*osContext2.get());
MockCommandStreamReceiver csr3(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext3(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield)));
csr3.setupContext(*osContext3.get());
MockCommandStreamReceiver csr4(executionEnvironment, 0, deviceBitfield);
std::unique_ptr<OsContext> osContext4(OsContext::create(nullptr, 0, 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::regular},
PreemptionMode::ThreadGroup, deviceBitfield)));
csr4.setupContext(*osContext4.get());
DirectSubmissionControllerMock controller;
EXPECT_EQ(controller.timeout.count(), 5'000);
controller.registerDirectSubmission(&csr);
EXPECT_EQ(controller.timeout.count(), 5'000);
controller.registerDirectSubmission(&csr3);
EXPECT_EQ(controller.timeout.count(), 5'000);
controller.registerDirectSubmission(&csr1);
EXPECT_EQ(controller.timeout.count(), 1'000);
controller.registerDirectSubmission(&csr2);
EXPECT_EQ(controller.timeout.count(), 200);
controller.registerDirectSubmission(&csr4);
EXPECT_EQ(controller.timeout.count(), 200);
controller.unregisterDirectSubmission(&csr);
controller.unregisterDirectSubmission(&csr1);
controller.unregisterDirectSubmission(&csr2);
controller.unregisterDirectSubmission(&csr3);
controller.unregisterDirectSubmission(&csr4);
}
TEST(DirectSubmissionControllerTests, givenDirectSubmissionControllerWhenEnqueueWaitForPagingFenceThenWaitInQueue) {
MockExecutionEnvironment executionEnvironment;
executionEnvironment.prepareRootDeviceEnvironments(1);

View File

@@ -105,4 +105,4 @@ HWTEST2_F(GfxCoreHelperXe2AndLaterTests, givenAtLeastXe2HpgWhenEncodeAdditionalT
storeRegMem = genCmdCast<MI_STORE_REGISTER_MEM *>(*(++storeRegMemIt));
EXPECT_EQ(storeRegMem->getRegisterAddress(), RegisterOffsets::globalTimestampUn);
EXPECT_EQ(storeRegMem->getMemoryAddress(), sndAddress + sizeof(uint32_t));
}
}

View File

@@ -76,4 +76,20 @@ LNLTEST_F(LnlProductHelperWindows, givenProductHelperWhenOverridePatIndexCalledT
LNLTEST_F(LnlProductHelperWindows, givenProductHelperWhenCheckIsCopyBufferRectSplitSupportedThenReturnsTrue) {
EXPECT_TRUE(productHelper->isCopyBufferRectSplitSupported());
}
LNLTEST_F(LnlProductHelperWindows, givenOverrideDirectSubmissionTimeoutsCalledThenTimeoutsAreOverridden) {
auto timeout = std::chrono::microseconds{5'000};
auto maxTimeout = timeout;
productHelper->overrideDirectSubmissionTimeouts(timeout, maxTimeout);
EXPECT_EQ(timeout.count(), 1'000);
EXPECT_EQ(maxTimeout.count(), 1'000);
DebugManagerStateRestore restorer{};
debugManager.flags.DirectSubmissionControllerTimeout.set(2'000);
debugManager.flags.DirectSubmissionControllerMaxTimeout.set(3'000);
productHelper->overrideDirectSubmissionTimeouts(timeout, maxTimeout);
EXPECT_EQ(timeout.count(), 2'000);
EXPECT_EQ(maxTimeout.count(), 3'000);
}

View File

@@ -62,3 +62,22 @@ PTLTEST_F(PtlProductHelperWindows, givenResolveDependenciesByPipeControllsNotSup
EXPECT_FALSE(productHelper->isResolveDependenciesByPipeControlsSupported(pInHwInfo, false, 3, csr));
EXPECT_FALSE(productHelper->isResolveDependenciesByPipeControlsSupported(pInHwInfo, false, 2, csrRelaxed));
}
PTLTEST_F(PtlProductHelperWindows, givenOverrideDirectSubmissionTimeoutsCalledThenTimeoutsAreOverridden) {
auto mockDevice = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto productHelper = &mockDevice->getProductHelper();
auto timeout = std::chrono::microseconds{5'000};
auto maxTimeout = timeout;
productHelper->overrideDirectSubmissionTimeouts(timeout, maxTimeout);
EXPECT_EQ(timeout.count(), 1'000);
EXPECT_EQ(maxTimeout.count(), 1'000);
DebugManagerStateRestore restorer{};
debugManager.flags.DirectSubmissionControllerTimeout.set(2'000);
debugManager.flags.DirectSubmissionControllerMaxTimeout.set(3'000);
productHelper->overrideDirectSubmissionTimeouts(timeout, maxTimeout);
EXPECT_EQ(timeout.count(), 2'000);
EXPECT_EQ(maxTimeout.count(), 3'000);
}