Skip to content

Commit 1a6c134

Browse files
author
Ryan Lai
authored
Fix build error WinMLRunner WritePerformanceDataToCSV (#135)
* Fix build error for passing string by reference * Made const
1 parent 9e94139 commit 1a6c134

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

Tools/WinMLRunner/src/OutputHelper.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,10 @@ class OutputHelper
340340
void WritePerformanceDataToCSV(
341341
const Profiler<WINML_MODEL_TEST_PERF> &profiler,
342342
int numIterations, std::wstring model,
343-
std::string& deviceType,
344-
std::string& inputBinding,
345-
std::string& inputType,
346-
std::string& deviceCreationLocation,
343+
const std::string& deviceType,
344+
const std::string& inputBinding,
345+
const std::string& inputType,
346+
const std::string& deviceCreationLocation,
347347
bool firstRunIgnored
348348
) const
349349
{

Tools/WinMLRunner/src/Run.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,14 +395,18 @@ HRESULT EvaluateModels(
395395
output.PrintResults(profiler, args.NumIterations(), deviceType, inputBindingType, inputDataType, deviceCreationLocation);
396396
if (args.IsOutputPerf())
397397
{
398+
std::string deviceTypeStringified = TypeHelper::Stringify(deviceType);
399+
std::string inputDataTypeStringified = TypeHelper::Stringify(inputDataType);
400+
std::string inputBindingTypeStringified = TypeHelper::Stringify(inputBindingType);
401+
std::string deviceCreationLocationStringified = TypeHelper::Stringify(deviceCreationLocation);
398402
output.WritePerformanceDataToCSV(
399403
profiler,
400404
args.NumIterations(),
401405
path,
402-
TypeHelper::Stringify(deviceType),
403-
TypeHelper::Stringify(inputDataType),
404-
TypeHelper::Stringify(inputBindingType),
405-
TypeHelper::Stringify(deviceCreationLocation),
406+
deviceTypeStringified,
407+
inputDataTypeStringified,
408+
inputBindingTypeStringified,
409+
deviceCreationLocationStringified,
406410
args.IsIgnoreFirstRun()
407411
);
408412
}

0 commit comments

Comments
 (0)