Custom winmlrunner
This commit is contained in:
Родитель
29e7c24e59
Коммит
cd8b0ff5e6
|
@ -7,6 +7,7 @@
|
|||
#include <filesystem>
|
||||
#include <codecvt>
|
||||
#include "Filehelper.h"
|
||||
#include "debugapi.h"
|
||||
|
||||
using namespace Windows::AI::MachineLearning;
|
||||
|
||||
|
@ -369,6 +370,18 @@ CommandLineArgs::CommandLineArgs(const std::vector<std::wstring>& args)
|
|||
CheckNextArgument(args, i);
|
||||
SetGarbageDataMaxValue(std::stoul(args[++i].c_str()));
|
||||
}
|
||||
else if ((_wcsicmp(args[i].c_str(), L"-WaitForDebugger") == 0))
|
||||
{
|
||||
while (!IsDebuggerPresent())
|
||||
{
|
||||
Sleep(100);
|
||||
}
|
||||
__debugbreak();
|
||||
}
|
||||
else if ((_wcsicmp(args[i].c_str(), L"-DisableMetacommands") == 0))
|
||||
{
|
||||
m_metacommandsDisabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstring msg = L"Unknown option ";
|
||||
|
|
|
@ -42,7 +42,11 @@ public:
|
|||
bool IsOutputPerf() const { return m_perfOutput; }
|
||||
bool IsSaveTensor() const { return m_saveTensor; }
|
||||
bool IsTimeLimitIterations() const { return m_timeLimitIterations; }
|
||||
BitmapInterpolationMode AutoScaleInterpMode() const { return m_autoScaleInterpMode; }
|
||||
bool IsMetacommandsDisabled() const { return m_metacommandsDisabled; }
|
||||
BitmapInterpolationMode AutoScaleInterpMode() const
|
||||
{
|
||||
return m_autoScaleInterpMode;
|
||||
}
|
||||
|
||||
const std::vector<std::wstring>& ImagePaths() const { return m_imagePaths; }
|
||||
const std::vector<ILearningModelFeatureValue>& ProvidedInputFeatureValues() const
|
||||
|
@ -185,6 +189,7 @@ private:
|
|||
BitmapInterpolationMode m_autoScaleInterpMode = BitmapInterpolationMode::Cubic;
|
||||
bool m_saveTensor = false;
|
||||
bool m_timeLimitIterations = false;
|
||||
bool m_metacommandsDisabled = false;
|
||||
std::wstring m_saveTensorMode = L"First";
|
||||
::TensorizeArgs m_tensorizeArgs;
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "Windows.AI.MachineLearning.Native.h"
|
||||
#include <codecvt>
|
||||
#include "OutputHelper.h"
|
||||
#include "windows.ai.machinelearning.native.internal.h"
|
||||
using namespace winrt::Windows::Graphics::DirectX::Direct3D11;
|
||||
|
||||
#ifdef DXCORE_SUPPORTED_BUILD
|
||||
|
@ -227,6 +228,10 @@ void PopulateLearningModelDeviceList(CommandLineArgs& args, std::vector<Learning
|
|||
deviceCreationLocation
|
||||
};
|
||||
OutputHelper::PrintLearningModelDevice(learningModelDeviceWithMetadata);
|
||||
if (deviceType != DeviceType::CPU && args.IsMetacommandsDisabled())
|
||||
{
|
||||
learningModelDeviceWithMetadata.LearningModelDevice.as<IMetacommandsController>()->SetMetacommandsEnabled(false);
|
||||
}
|
||||
deviceList.push_back(learningModelDeviceWithMetadata);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "Common.h"
|
||||
#include <iostream>
|
||||
#include <codecvt>
|
||||
#include "winrt\base.h"
|
||||
using namespace std;
|
||||
|
||||
void PopulateSessionOptions(LearningModelSessionOptions& sessionOptions)
|
||||
|
|
Загрузка…
Ссылка в новой задаче