mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-26 06:42:33 +08:00
refactor: Add GDI profiling
Resolves: NEO-9236 Related-To: NEO-10036 Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ce17580b28
commit
486cc71b76
@@ -47,8 +47,34 @@ TEST(GdiInterface, givenGdiOverridePathWhenGdiInterfaceIsCalledThenOverridePathI
|
||||
Os::gdiDllName = oldName;
|
||||
}
|
||||
|
||||
TEST(GdiInterface, givenPrintKmdTimesWhenCallThkWrapperThenRecordTime) {
|
||||
if (!GdiLogging::gdiLoggingSupport) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
debugManager.flags.PrintKmdTimes.set(1);
|
||||
|
||||
auto gdi = std::make_unique<Gdi>();
|
||||
EXPECT_TRUE(gdi->isInitialized());
|
||||
|
||||
testing::internal::CaptureStdout();
|
||||
|
||||
D3DKMT_OPENADAPTERFROMLUID param = {};
|
||||
gdi->openAdapterFromLuid(¶m);
|
||||
gdi->openAdapterFromLuid(¶m);
|
||||
D3DKMT_CLOSEADAPTER closeAdapter = {};
|
||||
closeAdapter.hAdapter = param.hAdapter;
|
||||
gdi->closeAdapter(&closeAdapter);
|
||||
|
||||
gdi.reset();
|
||||
auto output = testing::internal::GetCapturedStdout();
|
||||
EXPECT_TRUE(output.find("\n--- Gdi statistics ---\n") != std::string::npos);
|
||||
}
|
||||
|
||||
TEST(ThkWrapperTest, givenThkWrapperWhenConstructedThenmFuncIsInitialized) {
|
||||
NEO::ThkWrapper<void *> wrapper;
|
||||
GdiProfiler profiler{};
|
||||
NEO::ThkWrapper<void *> wrapper(profiler, "nullptr", 0u);
|
||||
EXPECT_EQ(nullptr, wrapper.mFunc);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user