onnxruntime/winml/lib/Api.Core/inc/CustomRegistryHelper.h
Brian Martin 1bc2ca6183
Brianma/breaks (#2469)
* fix some more breaks

* learning model doesn't need lotusEnvironment and CPU shouldn't include dmlEP headers

* move dml checks out of winml and into the adapter

* better error handling
2019-11-25 11:11:30 -08:00

30 lines
807 B
C++

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#pragma once
#ifdef USE_DML
#include "core/providers/dml/DmlExecutionProvider/src/AbiCustomRegistry.h"
namespace Windows::AI::MachineLearning::Adapter {
inline std::list<std::shared_ptr<onnxruntime::CustomRegistry>>
GetLotusCustomRegistries(
IMLOperatorRegistry* registry) {
if (registry != nullptr) {
// Down-cast to the concrete type.
// The only supported input is the AbiCustomRegistry type.
// Other implementations of IMLOperatorRegistry are forbidden.
auto abi_custom_registry =
static_cast<AbiCustomRegistry*>(registry);
// Get the ORT registry
return abi_custom_registry->GetRegistries();
}
return {};
}
} // namespace Windows::AI::MachineLearning::Adapter
#endif USE_DML