mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-18 01:54:05 +00:00
* Add winml macro wrappers on top of google test macros * change test methods to disabled * Add custom winml macros for both taef and google tests * PR comments * Refactor winml api tests * Move additional gtest specific macro definition into googleTestMacros.h
29 lines
1.1 KiB
C++
29 lines
1.1 KiB
C++
//-----------------------------------------------------------------------------
|
|
//
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
//
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
#include "fileHelpers.h"
|
|
namespace APITest {
|
|
static void LoadModel(const std::wstring& modelPath,
|
|
winrt::Windows::AI::MachineLearning::LearningModel& learningModel) {
|
|
std::wstring fullPath = FileHelpers::GetModulePath() + modelPath;
|
|
learningModel = winrt::Windows::AI::MachineLearning::LearningModel::LoadFromFilePath(fullPath);
|
|
};
|
|
|
|
static uint64_t GetAdapterIdQuadPart(winrt::Windows::AI::MachineLearning::LearningModelDevice& device) {
|
|
LARGE_INTEGER id;
|
|
id.LowPart = device.AdapterId().LowPart;
|
|
id.HighPart = device.AdapterId().HighPart;
|
|
return id.QuadPart;
|
|
};
|
|
|
|
static _LUID GetAdapterIdAsLUID(winrt::Windows::AI::MachineLearning::LearningModelDevice& device) {
|
|
_LUID id;
|
|
id.LowPart = device.AdapterId().LowPart;
|
|
id.HighPart = device.AdapterId().HighPart;
|
|
return id;
|
|
}
|
|
}; // namespace APITest
|