onnxruntime/winml/adapter/CustomRegistryHelper.h

31 lines
807 B
C
Raw Normal View History

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