2019-08-15 22:27:05 +00:00
|
|
|
// Copyright (c) Microsoft Corporation.
|
|
|
|
|
// Licensed under the MIT License.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2019-11-25 19:11:30 +00:00
|
|
|
#ifdef USE_DML
|
2019-08-15 22:27:05 +00:00
|
|
|
#include "core/providers/dml/DmlExecutionProvider/src/AbiCustomRegistry.h"
|
|
|
|
|
|
2019-11-15 01:44:07 +00:00
|
|
|
namespace Windows::AI::MachineLearning::Adapter {
|
2019-08-15 22:27:05 +00:00
|
|
|
|
|
|
|
|
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 =
|
2019-11-15 01:44:07 +00:00
|
|
|
static_cast<AbiCustomRegistry*>(registry);
|
2019-08-15 22:27:05 +00:00
|
|
|
|
|
|
|
|
// Get the ORT registry
|
|
|
|
|
return abi_custom_registry->GetRegistries();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-25 19:11:30 +00:00
|
|
|
} // namespace Windows::AI::MachineLearning::Adapter
|
|
|
|
|
|
|
|
|
|
#endif USE_DML
|