From 0c6c0d51e11b2af3aec776cef6b57bc43d1b1dd7 Mon Sep 17 00:00:00 2001 From: Brian Martin Date: Fri, 29 Jul 2022 15:57:38 -0700 Subject: [PATCH] make cpu fallback log warnings if highperf or minpower was specified. --- Tools/WinMLRunner/src/EventTraceHelper.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tools/WinMLRunner/src/EventTraceHelper.cpp b/Tools/WinMLRunner/src/EventTraceHelper.cpp index 11530fa3..dc7d3549 100644 --- a/Tools/WinMLRunner/src/EventTraceHelper.cpp +++ b/Tools/WinMLRunner/src/EventTraceHelper.cpp @@ -550,7 +550,9 @@ void EventTraceHelper::Start() // represents the "UseGPU()" flag, and the last bit represents the "IsLogCPUFallbackEnabled()" // flag. We use the Context field later on when the event is handled and we no longer // have access to the m_commandArgs object. - int64_t icontext = ((int64_t)m_commandArgs.UseGPU() << 1) | ((int64_t)m_commandArgs.IsLogCPUFallbackEnabled()); + bool usingAnyGPU = + m_commandArgs.UseGPU() || m_commandArgs.IsUsingGPUHighPerformance() || m_commandArgs.IsUsingGPUMinPower(); + int64_t icontext = ((int64_t)usingAnyGPU << 1) | ((int64_t)m_commandArgs.IsLogCPUFallbackEnabled()); loggerInfo.Context = (void*)(icontext); // LoggerName is the sessionName that we had provided in StartTrace