onnxruntime/winml/test/api/LearningModelSessionAPITest.h
Ryan Lai 5ce675c3b9
Expose Onnxruntime Intra Op thread controls through WinML Native API (#4638)
* Register ILearningModelSessionOptionsNate interface

* Threading options exposed

* Add interrogator for Session options

* Add test

* Polish test

* PR comments

* Set intra op threads

* Add adapter api to grab intra op threads

* Add adapter test for getting intraop num threads

* Make ILearningModelSessionNative and update winml api test

* Make it required when building engine to set the intraop num threads

* Make test  more pretty

* Change naming of idl function

* Revert "Change naming of idl function"

This reverts commit c06916aa5bf94e3bf233ed281e508b935fc8638d.

* PR comment on naming

* Skip the test because it's influenced if it's built with openmp

Co-authored-by: Ryan Lai <ryalai96@gamil.com>
2020-07-30 17:55:26 -07:00

43 lines
2 KiB
C

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "test.h"
struct LearningModelSessionAPITestsApi {
SetupClass LearningModelSessionAPITestsClassSetup;
VoidTest CreateSessionDeviceDefault;
VoidTest CreateSessionDeviceCpu;
VoidTest CreateSessionWithModelLoadedFromStream;
VoidTest CreateSessionDeviceDirectX;
VoidTest CreateSessionDeviceDirectXHighPerformance;
VoidTest CreateSessionDeviceDirectXMinimumPower;
VoidTest AdapterIdAndDevice;
VoidTest EvaluateFeatures;
VoidTest EvaluateFeaturesAsync;
VoidTest EvaluationProperties;
VoidTest CreateSessionWithCastToFloat16InModel;
VoidTest CreateSessionWithFloat16InitializersInModel;
VoidTest EvaluateSessionAndCloseModel;
VoidTest CloseSession;
VoidTest SetIntraOpNumThreads;
};
const LearningModelSessionAPITestsApi& getapi();
WINML_TEST_CLASS_BEGIN(LearningModelSessionAPITests)
WINML_TEST_CLASS_SETUP_CLASS(LearningModelSessionAPITestsClassSetup)
WINML_TEST_CLASS_BEGIN_TESTS
WINML_TEST(LearningModelSessionAPITests, CreateSessionDeviceDefault)
WINML_TEST(LearningModelSessionAPITests,CreateSessionDeviceCpu)
WINML_TEST(LearningModelSessionAPITests,CreateSessionWithModelLoadedFromStream)
WINML_TEST(LearningModelSessionAPITests,EvaluateFeatures)
WINML_TEST(LearningModelSessionAPITests,EvaluateFeaturesAsync)
WINML_TEST(LearningModelSessionAPITests,EvaluationProperties)
WINML_TEST(LearningModelSessionAPITests,EvaluateSessionAndCloseModel)
WINML_TEST(LearningModelSessionAPITests, CreateSessionDeviceDirectX)
WINML_TEST(LearningModelSessionAPITests, CreateSessionDeviceDirectXHighPerformance)
WINML_TEST(LearningModelSessionAPITests, CreateSessionDeviceDirectXMinimumPower)
WINML_TEST(LearningModelSessionAPITests, CreateSessionWithCastToFloat16InModel)
WINML_TEST(LearningModelSessionAPITests, CreateSessionWithFloat16InitializersInModel)
WINML_TEST(LearningModelSessionAPITests, AdapterIdAndDevice)
WINML_TEST(LearningModelSessionAPITests, SetIntraOpNumThreads)
WINML_TEST_CLASS_END()