mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
feature: additional checkers to enable feature
Resolves: NEO-13973 Signed-off-by: Damian Tomczak <damian.tomczak@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
4bc13fa0dc
commit
0243004907
@@ -61,6 +61,7 @@ class MockCompilerProductHelper : public CompilerProductHelper {
|
||||
ADDMETHOD_CONST_NOBASE_VOIDRETURN(getKernelFp64AtomicCapabilities, (uint32_t & fp64Caps));
|
||||
ADDMETHOD_CONST_NOBASE_VOIDRETURN(getKernelCapabilitiesExtra, (const ReleaseHelper *releaseHelper, uint32_t &extraCaps));
|
||||
ADDMETHOD_CONST_NOBASE(isBindlessAddressingDisabled, bool, false, (const ReleaseHelper *releaseHelper));
|
||||
ADDMETHOD_CONST_NOBASE(isForceBindlessRequired, bool, false, ());
|
||||
ADDMETHOD_CONST_NOBASE(getProductConfigFromHwInfo, uint32_t, 0, (const HardwareInfo &hwInfo));
|
||||
ADDMETHOD_CONST_NOBASE(getCustomIgcLibraryName, const char *, nullptr, ());
|
||||
ADDMETHOD_CONST_NOBASE(getFinalizerLibraryName, const char *, nullptr, ());
|
||||
|
||||
@@ -38,8 +38,8 @@ class DrmCommandStreamTest : public ::testing::Test {
|
||||
public:
|
||||
template <typename GfxFamily>
|
||||
void setUpT() {
|
||||
|
||||
// make sure this is disabled, we don't want to test this now
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
debugManager.flags.EnableForcePin.set(false);
|
||||
|
||||
mock = new DrmMock(mockFd, *executionEnvironment.rootDeviceEnvironments[0]);
|
||||
@@ -127,6 +127,7 @@ class DrmCommandStreamEnhancedTemplate : public ::testing::Test {
|
||||
this->dbgState = std::make_unique<DebugManagerStateRestore>();
|
||||
// make sure this is disabled, we don't want to test this now
|
||||
debugManager.flags.EnableForcePin.set(false);
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
|
||||
mock = DrmType::create(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]).release();
|
||||
executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->osInterface = std::make_unique<OSInterface>();
|
||||
|
||||
@@ -29,6 +29,7 @@ using namespace NEO;
|
||||
|
||||
struct DeviceCommandStreamLeaksTest : ::testing::Test {
|
||||
void SetUp() override {
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
HardwareInfo *hwInfo = nullptr;
|
||||
executionEnvironment = getExecutionEnvironmentImpl(hwInfo, 1);
|
||||
executionEnvironment->incRefInternal();
|
||||
@@ -40,9 +41,12 @@ struct DeviceCommandStreamLeaksTest : ::testing::Test {
|
||||
}
|
||||
|
||||
ExecutionEnvironment *executionEnvironment;
|
||||
DebugManagerStateRestore dbgState;
|
||||
};
|
||||
|
||||
HWTEST_F(DeviceCommandStreamLeaksTest, WhenCreatingDeviceCsrThenValidPointerIsReturned) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
std::unique_ptr<CommandStreamReceiver> ptr(DeviceCommandStreamReceiver<FamilyType>::create(false, *executionEnvironment, 0, 1));
|
||||
DrmMockSuccess mockDrm(mockFd, *executionEnvironment->rootDeviceEnvironments[0]);
|
||||
EXPECT_NE(nullptr, ptr);
|
||||
@@ -62,6 +66,8 @@ HWTEST_F(DeviceCommandStreamLeaksTest, givenDefaultDrmCsrWithAubDumWhenItIsCreat
|
||||
}
|
||||
|
||||
HWTEST_F(DeviceCommandStreamLeaksTest, givenDefaultDrmCsrWhenOsInterfaceIsNullptrThenValidateDrm) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
std::unique_ptr<CommandStreamReceiver> ptr(DeviceCommandStreamReceiver<FamilyType>::create(false, *executionEnvironment, 0, 1));
|
||||
auto drmCsr = (DrmCommandStreamReceiver<FamilyType> *)ptr.get();
|
||||
EXPECT_NE(nullptr, executionEnvironment->rootDeviceEnvironments[0]->osInterface);
|
||||
@@ -89,6 +95,7 @@ HWTEST_F(DeviceCommandStreamLeaksTest, givenDisabledGemCloseWorkerWhenCsrIsCreat
|
||||
HWTEST_F(DeviceCommandStreamLeaksTest, givenEnabledGemCloseWorkerWhenCsrIsCreatedThenGemCloseWorkerActiveModeIsSelected) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.EnableGemCloseWorker.set(1u);
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
|
||||
executionEnvironment->memoryManager = DrmMemoryManager::create(*executionEnvironment);
|
||||
|
||||
@@ -103,6 +110,9 @@ HWTEST_F(DeviceCommandStreamLeaksTest, givenEnabledGemCloseWorkerWhenCsrIsCreate
|
||||
}
|
||||
|
||||
HWTEST_F(DeviceCommandStreamLeaksTest, givenDefaultGemCloseWorkerWhenCsrIsCreatedThenGemCloseWorkerActiveModeIsSelected) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
|
||||
executionEnvironment->memoryManager = DrmMemoryManager::create(*executionEnvironment);
|
||||
std::unique_ptr<CommandStreamReceiver> ptr(DeviceCommandStreamReceiver<FamilyType>::create(false, *executionEnvironment, 0, 1));
|
||||
auto osContext = OsContext::create(executionEnvironment->rootDeviceEnvironments[0]->osInterface.get(), 0, 0,
|
||||
|
||||
@@ -40,6 +40,7 @@ struct DrmCommandStreamMemExecTest : public DrmCommandStreamEnhancedTemplate<Drm
|
||||
HWTEST_F(DrmCommandStreamMMTest, GivenForcePinThenMemoryManagerCreatesPinBb) {
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
debugManager.flags.EnableForcePin.set(true);
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
auto drm = DrmMockCustom::create(*executionEnvironment.rootDeviceEnvironments[0]).release();
|
||||
@@ -60,6 +61,7 @@ HWTEST_F(DrmCommandStreamMMTest, GivenForcePinThenMemoryManagerCreatesPinBb) {
|
||||
HWTEST_F(DrmCommandStreamMMTest, givenForcePinDisabledWhenMemoryManagerIsCreatedThenPinBBIsCreated) {
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
debugManager.flags.EnableForcePin.set(false);
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
auto drm = DrmMockCustom::create(*executionEnvironment.rootDeviceEnvironments[0]).release();
|
||||
|
||||
@@ -26,6 +26,8 @@ extern ApiSpecificConfig::ApiType apiTypeForUlts;
|
||||
using namespace NEO;
|
||||
|
||||
HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenL0ApiConfigWhenCreatingDrmCsrThenEnableImmediateDispatch) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
VariableBackup<ApiSpecificConfig::ApiType> backup(&apiTypeForUlts, ApiSpecificConfig::L0);
|
||||
MockDrmCsr<FamilyType> csr(executionEnvironment, 0, 1);
|
||||
EXPECT_EQ(DispatchMode::immediateDispatch, csr.dispatchMode);
|
||||
@@ -85,6 +87,9 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenNoTagAddressWhenGettingCompletionA
|
||||
}
|
||||
|
||||
HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenExecBufferErrorWhenFlushInternalThenProperErrorIsReturned) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
|
||||
mock->execBufferResult = -1;
|
||||
mock->baseErrno = false;
|
||||
mock->errnoRetVal = EWOULDBLOCK;
|
||||
@@ -1356,6 +1361,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest,
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.EnableUserFenceForCompletionWait.set(0);
|
||||
debugManager.flags.OverrideNotifyEnableForTagUpdatePostSync.set(1);
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
|
||||
mock->isVmBindAvailableCall.callParent = false;
|
||||
mock->isVmBindAvailableCall.returnValue = true;
|
||||
|
||||
@@ -409,6 +409,8 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenCheckFlagsWhenFlushingThenSucceeds
|
||||
}
|
||||
|
||||
HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenCheckDrmFreeWhenFlushingThenSucceeds) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
mock->returnHandle = 17;
|
||||
|
||||
auto &cs = csr->getCS();
|
||||
|
||||
@@ -375,6 +375,8 @@ class DrmCommandStreamForceTileTest : public ::testing::Test {
|
||||
};
|
||||
template <typename GfxFamily>
|
||||
void setUpT() {
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
|
||||
mock = new DrmMock(mockFd, *executionEnvironment.rootDeviceEnvironments[0]);
|
||||
|
||||
auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo();
|
||||
@@ -423,6 +425,7 @@ class DrmCommandStreamForceTileTest : public ::testing::Test {
|
||||
const uint32_t rootDeviceIndex = 0u;
|
||||
const uint32_t expectedHandleId = 1u;
|
||||
|
||||
DebugManagerStateRestore restorer;
|
||||
CommandStreamReceiver *csr = nullptr;
|
||||
DrmMemoryManager *memoryManager = nullptr;
|
||||
DrmMock *mock = nullptr;
|
||||
@@ -477,6 +480,8 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenPrintIndicesEnabledWhenFlushThenPr
|
||||
|
||||
struct DrmImplicitScalingCommandStreamTest : ::testing::Test {
|
||||
void SetUp() override {
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
|
||||
executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
|
||||
@@ -525,9 +530,13 @@ struct DrmImplicitScalingCommandStreamTest : ::testing::Test {
|
||||
std::unique_ptr<OsContextLinux> osContext;
|
||||
DrmMemoryManager *memoryManager;
|
||||
std::unique_ptr<HardwareInfo> hwInfo;
|
||||
DebugManagerStateRestore restorer;
|
||||
};
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, givenTwoTilesWhenFlushIsCalledThenExecIsExecutedOnEveryTile) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
|
||||
auto csr = createCsr<FamilyType>();
|
||||
|
||||
auto size = 1024u;
|
||||
@@ -627,6 +636,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, whenForceExecu
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForceExecutionTile.set(1);
|
||||
debugManager.flags.EnableWalkerPartition.set(0);
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
|
||||
struct MockCsr : DrmCommandStreamReceiver<FamilyType> {
|
||||
using DrmCommandStreamReceiver<FamilyType>::DrmCommandStreamReceiver;
|
||||
@@ -668,6 +678,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, whenForceExecu
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, givenDisabledImplicitScalingWhenFlushingThenUseOnlyOneContext) {
|
||||
DebugManagerStateRestore debugRestore{};
|
||||
debugManager.flags.EnableWalkerPartition.set(0);
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
|
||||
struct MockCsr : DrmCommandStreamReceiver<FamilyType> {
|
||||
using DrmCommandStreamReceiver<FamilyType>::DrmCommandStreamReceiver;
|
||||
@@ -706,6 +717,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, givenDisabledI
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, givenMultiTileCsrWhenFlushThenVmHandleIdEqualsTileId) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForceL3FlushAfterPostSync.set(0);
|
||||
struct MockCsr : DrmCommandStreamReceiver<FamilyType> {
|
||||
using DrmCommandStreamReceiver<FamilyType>::DrmCommandStreamReceiver;
|
||||
int exec(const BatchBuffer &batchBuffer, uint32_t vmHandleId, uint32_t drmContextId, uint32_t index) override {
|
||||
|
||||
Reference in New Issue
Block a user