Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix minimal build
  • Loading branch information
skottmckay committed Jul 22, 2025
commit 0530525e24f4f4eace11f05dce3d6dbd46666cdf
2 changes: 2 additions & 0 deletions onnxruntime/core/session/environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,13 @@ Environment::~Environment() {
// need to make sure all the OrtAllocator instances are released prior to any plugin EPs being freed
shared_allocators_.clear();

#if !defined(ORT_MINIMAL_BUILD)
// unregister any remaining EP libraries
while (!ep_libraries_.empty()) {
auto it = ep_libraries_.begin();
ORT_IGNORE_RETURN_VALUE(UnregisterExecutionProviderLibrary(it->first));
}
#endif
}

AllocatorPtr Environment::GetRegisteredSharedAllocator(const OrtMemoryInfo& mem_info) const {
Expand Down
8 changes: 5 additions & 3 deletions onnxruntime/python/onnxruntime_pybind_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1907,14 +1907,16 @@ void addObjectMethods(py::module& m, ExecutionProviderRegistrationFn ep_registra
.def("device_id", &OrtDevice::Id, R"pbdoc(Device Id.)pbdoc")
.def("device_type", &OrtDevice::Type, R"pbdoc(Device Type.)pbdoc")
.def("vendor_id", &OrtDevice::Vendor, R"pbdoc(Vendor Id.)pbdoc")
// generic device types that are typically used with a vendor id.
.def_static("cpu", []() { return OrtDevice::CPU; })
.def_static("gpu", []() { return OrtDevice::GPU; })
.def_static("npu", []() { return OrtDevice::NPU; })
// EP specific device types for backward compatibility.
.def_static("cuda", []() { return OrtDevice::GPU; })
.def_static("cann", []() { return OrtDevice::NPU; })
.def_static("fpga", []() { return OrtDevice::FPGA; })
.def_static("npu", []() { return OrtDevice::NPU; })
.def_static("dml", []() { return OrtDevice::DML; })
.def_static("fpga", []() { return OrtDevice::FPGA; })
.def_static("webgpu", []() { return OrtDevice::GPU; })
.def_static("gpu", []() { return OrtDevice::GPU; })
.def_static("default_memory", []() { return OrtDevice::MemType::DEFAULT; });

py::enum_<OrtExecutionProviderDevicePolicy>(m, "OrtExecutionProviderDevicePolicy")
Expand Down
Loading