Fix WinML namespace build break (#3583)

* Add missing winrt namespace

* Conditional compilation of dxcore code

* Fix TAEF macros
This commit is contained in:
Tiago Koji Castro Shibata 2020-04-18 20:46:01 -07:00 committed by GitHub
parent 56b223bc60
commit 14e387aa1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 5 deletions

View file

@ -63,7 +63,7 @@ D3DDeviceCache::D3DDeviceCache(winml::LearningModelDeviceKind const& deviceKind)
}
#ifdef ENABLE_DXCORE
if (support.has_dxgi == false) {
com_ptr<IDXCoreAdapter> spAdapter;
winrt::com_ptr<IDXCoreAdapter> spAdapter;
WINML_THROW_IF_FAILED_MSG(GetDXCoreHardwareAdapterWithPreference(preference, spAdapter.put()), errStr);
WINML_THROW_IF_FAILED(D3D12CreateDevice(spAdapter.get(), D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(device_.put())));
}

View file

@ -7,6 +7,8 @@
#include <initguid.h>
#include <d3d11.h>
#include "NamespaceAliases.h"
#if __has_include("dxcore.h")
#define ENABLE_DXCORE 1
#endif

View file

@ -29,7 +29,7 @@ static void LearningModelSessionAPITestsGpuMethodSetup() {
static void LearningModelSessionAPITestsGpuSkipEdgeCoreMethodSetup() {
LearningModelSessionAPITestsGpuMethodSetup();
SKIP_EDGECORE
SKIP_EDGECORE;
}
static void CreateSessionDeviceDefault()

View file

@ -16,7 +16,7 @@ using namespace WEX::TestExecution;
TEST_CLASS(test_class_name);
#define WINML_TEST_CLASS_SETUP_CLASS(setup_class) \
TEST_CLASS_SETUP(TestMethodSetup) { \
TEST_CLASS_SETUP(TestClassSetup) { \
getapi().setup_class(); \
return true; \
}

View file

@ -55,12 +55,12 @@ static void ScenarioCppWinrtTestsGpuMethodSetup() {
};
static void ScenarioCppWinrtTestsSkipEdgeCoreMethodSetup() {
SKIP_EDGECORE
SKIP_EDGECORE;
};
static void ScenarioCppWinrtTestsGpuSkipEdgeCoreMethodSetup() {
ScenarioCppWinrtTestsGpuMethodSetup();
SKIP_EDGECORE
SKIP_EDGECORE;
};
static void Sample1() {