Skip to content

Add support for metadata and termination. #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion onnxruntime-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ keywords = ["neuralnetworks", "onnx", "bindings"]
[dependencies]

[build-dependencies]
bindgen = { version = "0.59", optional = true }
bindgen = { version = "0.63", optional = true }
ureq = "2.1"

# Used on Windows
Expand Down
23 changes: 12 additions & 11 deletions onnxruntime-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::{
/// WARNING: If version is changed, bindings for all platforms will have to be re-generated.
/// To do so, run this:
/// cargo build --package onnxruntime-sys --features generate-bindings
const ORT_VERSION: &str = "1.8.1";
const ORT_VERSION: &str = "1.13.1";

/// Base Url from which to download pre-built releases/
const ORT_RELEASE_BASE_URL: &str = "https://github.com/microsoft/onnxruntime/releases/download";
Expand Down Expand Up @@ -110,7 +110,7 @@ fn generate_bindings(include_dir: &Path) {
.size_t_is_usize(true)
// Format using rustfmt
.rustfmt_bindings(true)
.rustified_enum("*")
.rustified_enum(".*")
// Finish the builder and generate the bindings.
.generate()
// Unwrap the Result and panic on failure.
Expand Down Expand Up @@ -310,31 +310,32 @@ struct Triplet {
impl OnnxPrebuiltArchive for Triplet {
fn as_onnx_str(&self) -> Cow<str> {
match (&self.os, &self.arch, &self.accelerator) {
// onnxruntime-win-x86-1.8.1.zip
// onnxruntime-win-x64-1.8.1.zip
// onnxruntime-win-arm-1.8.1.zip
// onnxruntime-win-arm64-1.8.1.zip
// onnxruntime-linux-x64-1.8.1.tgz
// onnxruntime-osx-x64-1.8.1.tgz
// onnxruntime-win-x86-$VERSION.zip
// onnxruntime-win-x64-$VERSION.zip
// onnxruntime-win-arm-$VERSION.zip
// onnxruntime-win-arm64-$VERSION.zip
// onnxruntime-linux-x64-$VERSION.tgz
// onnxruntime-osx-x64-$VERSION.tgz
(Os::Windows, Architecture::X86, Accelerator::None)
| (Os::Windows, Architecture::X86_64, Accelerator::None)
| (Os::Windows, Architecture::Arm, Accelerator::None)
| (Os::Windows, Architecture::Arm64, Accelerator::None)
| (Os::Linux, Architecture::X86_64, Accelerator::None)
| (Os::MacOs, Architecture::X86_64, Accelerator::None) => Cow::from(format!(
| (Os::MacOs, Architecture::X86_64, Accelerator::None)
| (Os::MacOs, Architecture::Arm64, Accelerator::None) => Cow::from(format!(
"{}-{}",
self.os.as_onnx_str(),
self.arch.as_onnx_str()
)),
// onnxruntime-win-gpu-x64-1.8.1.zip
// onnxruntime-win-gpu-x64-$VERSION.zip
// Note how this one is inverted from the linux one next
(Os::Windows, Architecture::X86_64, Accelerator::Gpu) => Cow::from(format!(
"{}-{}-{}",
self.os.as_onnx_str(),
self.accelerator.as_onnx_str(),
self.arch.as_onnx_str(),
)),
// onnxruntime-linux-x64-gpu-1.8.1.tgz
// onnxruntime-linux-x64-gpu-$VERSION.tgz
// Note how this one is inverted from the windows one above
(Os::Linux, Architecture::X86_64, Accelerator::Gpu) => Cow::from(format!(
"{}-{}-{}",
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime-sys/examples/c_api_sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ fn main() {

let output_node_names_cstring: Vec<std::ffi::CString> = output_node_names
.into_iter()
.map(|n| std::ffi::CString::new(n.clone()).unwrap())
.map(|n| std::ffi::CString::new(*n).unwrap())
.collect();
let output_node_names_ptr: Vec<*const i8> = output_node_names_cstring
.iter()
Expand Down
Loading