Skip to content

Commit 025aab4

Browse files
author
Ryan Lai
authored
Add profiling for creating session with -gpuadaptername flag (#233)
1 parent b803e66 commit 025aab4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Tools/WinMLRunner/src/Run.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,15 @@ HRESULT CreateSession(LearningModelSession& session, IDirect3DDevice& winrtDevic
317317
com_ptr<::IUnknown> spUnkLearningModelDevice;
318318
THROW_IF_FAILED(
319319
factory->CreateFromD3D12CommandQueue(d3d12CommandQueue.get(), spUnkLearningModelDevice.put()));
320+
if (args.IsPerformanceCapture())
321+
{
322+
WINML_PROFILING_START(profiler, WINML_MODEL_TEST_PERF::CREATE_SESSION);
323+
}
320324
session = LearningModelSession(model, spUnkLearningModelDevice.as<LearningModelDevice>());
325+
if (args.IsPerformanceCapture())
326+
{
327+
WINML_PROFILING_STOP(profiler, WINML_MODEL_TEST_PERF::CREATE_SESSION);
328+
}
321329
}
322330
#endif
323331
else

0 commit comments

Comments
 (0)