Skip to content
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

bump to 1.14.1 and support Apple M1 #121

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
24 changes: 15 additions & 9 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.14.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 @@ -310,12 +310,12 @@ 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-1.14.1.zip
// onnxruntime-win-x64-1.14.1.zip
// onnxruntime-win-arm-1.14.1.zip
// onnxruntime-win-arm64-1.14.1.zip
// onnxruntime-linux-x64-1.14.1.tgz
// onnxruntime-osx-x64-1.14.1.tgz
(Os::Windows, Architecture::X86, Accelerator::None)
| (Os::Windows, Architecture::X86_64, Accelerator::None)
| (Os::Windows, Architecture::Arm, Accelerator::None)
Expand All @@ -326,15 +326,21 @@ impl OnnxPrebuiltArchive for Triplet {
self.os.as_onnx_str(),
self.arch.as_onnx_str()
)),
// onnxruntime-win-gpu-x64-1.8.1.zip
// onnxruntime-osx-arm64-1.14.1.tgz
(Os::MacOs, Architecture::Arm64, Accelerator::None) => Cow::from(format!(
"{}-{}",
self.os.as_onnx_str(),
self.arch.as_onnx_str(),
)),
// onnxruntime-win-gpu-x64-1.14.1.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-1.14.1.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: 0 additions & 2 deletions onnxruntime-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#![allow(clippy::all)]
#![allow(improper_ctypes)]

#[allow(clippy::all)]

include!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/src/generated/bindings.rs"
Expand Down
1 change: 1 addition & 0 deletions onnxruntime/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ impl<'a> SessionBuilder<'a> {
/// Type storing the session information, built from an [`Environment`](environment/struct.Environment.html)
#[derive(Debug)]
pub struct Session<'a> {
#[allow(dead_code)]
env: &'a Environment,
session_ptr: *mut sys::OrtSession,
allocator_ptr: *mut sys::OrtAllocator,
Expand Down
1 change: 1 addition & 0 deletions onnxruntime/src/tensor/ort_owned_tensor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ where
{
pub(crate) tensor_ptr: *mut sys::OrtValue,
array_view: ArrayView<'t, T, D>,
#[allow(dead_code)]
memory_info: &'m MemoryInfo,
}

Expand Down
1 change: 1 addition & 0 deletions onnxruntime/src/tensor/ort_tensor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ where
{
pub(crate) c_ptr: *mut sys::OrtValue,
array: Array<T, D>,
#[allow(dead_code)]
memory_info: &'t MemoryInfo,
}

Expand Down