Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Commit

Permalink
feat: update all bindings to ONNX Runtime v1.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dkim-furiosa committed May 20, 2022
1 parent 979816b commit 9769ca3
Show file tree
Hide file tree
Showing 4 changed files with 557 additions and 8 deletions.
4 changes: 2 additions & 2 deletions 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 --features generate-bindings
const ORT_VERSION: &str = "1.10.0";
const ORT_VERSION: &str = "1.11.0";

/// 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 @@ -301,7 +301,7 @@ impl OnnxPrebuiltArchive for Triplet {
| (Os::MacOs, Architecture::Arm64, Accelerator::None) => {
Cow::from(format!("{}-{}", self.os.as_onnx_str(), self.arch.as_onnx_str()))
}
// onnxruntime-linux-aarch64-1.0.0.tgz
// onnxruntime-linux-aarch64-1.10.0.tgz
(Os::Linux, Architecture::Arm64, Accelerator::None) => {
Cow::from(format!("{}-{}", self.os.as_onnx_str(), "aarch64"))
}
Expand Down
187 changes: 185 additions & 2 deletions src/generated/linux/x86_64/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ pub const _STRING_H: u32 = 1;
pub const _BITS_TYPES_LOCALE_T_H: u32 = 1;
pub const _BITS_TYPES___LOCALE_T_H: u32 = 1;
pub const _STRINGS_H: u32 = 1;
pub const ORT_API_VERSION: u32 = 10;
pub const ORT_API_VERSION: u32 = 11;
pub type wchar_t = ::std::os::raw::c_int;
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
Expand Down Expand Up @@ -2439,6 +2439,11 @@ pub struct OrtPrepackedWeightsContainer {
pub struct OrtTensorRTProviderOptionsV2 {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OrtCUDAProviderOptionsV2 {
_unused: [u8; 0],
}
pub type OrtStatusPtr = *mut OrtStatus;
#[doc = " \\brief Memory allocation interface"]
#[doc = ""]
Expand Down Expand Up @@ -3154,6 +3159,67 @@ fn bindgen_test_layout_OrtTensorRTProviderOptions() {
)
);
}
#[doc = " \\brief MIGraphX Provider Options"]
#[doc = ""]
#[doc = " \\see OrtApi::SessionOptionsAppendExecutionProvider_MIGraphX"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OrtMIGraphXProviderOptions {
pub device_id: ::std::os::raw::c_int,
pub migraphx_fp16_enable: ::std::os::raw::c_int,
pub migraphx_int8_enable: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_OrtMIGraphXProviderOptions() {
assert_eq!(
::std::mem::size_of::<OrtMIGraphXProviderOptions>(),
12usize,
concat!("Size of: ", stringify!(OrtMIGraphXProviderOptions))
);
assert_eq!(
::std::mem::align_of::<OrtMIGraphXProviderOptions>(),
4usize,
concat!("Alignment of ", stringify!(OrtMIGraphXProviderOptions))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<OrtMIGraphXProviderOptions>())).device_id as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(OrtMIGraphXProviderOptions),
"::",
stringify!(device_id)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<OrtMIGraphXProviderOptions>())).migraphx_fp16_enable as *const _
as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(OrtMIGraphXProviderOptions),
"::",
stringify!(migraphx_fp16_enable)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<OrtMIGraphXProviderOptions>())).migraphx_int8_enable as *const _
as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(OrtMIGraphXProviderOptions),
"::",
stringify!(migraphx_int8_enable)
)
);
}
#[doc = " \\brief OpenVINO Provider Options"]
#[doc = ""]
#[doc = " \\see OrtApi::SessionOptionsAppendExecutionProvider_OpenVINO"]
Expand Down Expand Up @@ -4550,12 +4616,49 @@ pub struct OrtApi {
::std::option::Option<unsafe extern "C" fn(binding_ptr: *mut OrtIoBinding) -> OrtStatusPtr>,
pub SynchronizeBoundOutputs:
::std::option::Option<unsafe extern "C" fn(binding_ptr: *mut OrtIoBinding) -> OrtStatusPtr>,
pub SessionOptionsAppendExecutionProvider_CUDA_V2: ::std::option::Option<
unsafe extern "C" fn(
options: *mut OrtSessionOptions,
cuda_options: *const OrtCUDAProviderOptionsV2,
) -> OrtStatusPtr,
>,
pub CreateCUDAProviderOptions: ::std::option::Option<
unsafe extern "C" fn(out: *mut *mut OrtCUDAProviderOptionsV2) -> OrtStatusPtr,
>,
pub UpdateCUDAProviderOptions: ::std::option::Option<
unsafe extern "C" fn(
cuda_options: *mut OrtCUDAProviderOptionsV2,
provider_options_keys: *const *const ::std::os::raw::c_char,
provider_options_values: *const *const ::std::os::raw::c_char,
num_keys: usize,
) -> OrtStatusPtr,
>,
pub GetCUDAProviderOptionsAsString: ::std::option::Option<
unsafe extern "C" fn(
cuda_options: *const OrtCUDAProviderOptionsV2,
allocator: *mut OrtAllocator,
ptr: *mut *mut ::std::os::raw::c_char,
) -> OrtStatusPtr,
>,
#[doc = " \\brief Release an ::OrtCUDAProviderOptionsV2"]
#[doc = ""]
#[doc = " \\note This is an exception in the naming convention of other Release* functions, as the name of the method does not have the V2 suffix, but the type does"]
#[doc = ""]
#[doc = " \\since Version 1.11."]
pub ReleaseCUDAProviderOptions:
::std::option::Option<unsafe extern "C" fn(input: *mut OrtCUDAProviderOptionsV2)>,
pub SessionOptionsAppendExecutionProvider_MIGraphX: ::std::option::Option<
unsafe extern "C" fn(
options: *mut OrtSessionOptions,
migraphx_options: *const OrtMIGraphXProviderOptions,
) -> OrtStatusPtr,
>,
}
#[test]
fn bindgen_test_layout_OrtApi() {
assert_eq!(
::std::mem::size_of::<OrtApi>(),
1632usize,
1680usize,
concat!("Size of: ", stringify!(OrtApi))
);
assert_eq!(
Expand Down Expand Up @@ -6114,6 +6217,80 @@ fn bindgen_test_layout_OrtApi() {
1624usize,
concat!("Offset of field: ", stringify!(OrtApi), "::", stringify!(SynchronizeBoundOutputs))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<OrtApi>())).SessionOptionsAppendExecutionProvider_CUDA_V2
as *const _ as usize
},
1632usize,
concat!(
"Offset of field: ",
stringify!(OrtApi),
"::",
stringify!(SessionOptionsAppendExecutionProvider_CUDA_V2)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<OrtApi>())).CreateCUDAProviderOptions as *const _ as usize
},
1640usize,
concat!(
"Offset of field: ",
stringify!(OrtApi),
"::",
stringify!(CreateCUDAProviderOptions)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<OrtApi>())).UpdateCUDAProviderOptions as *const _ as usize
},
1648usize,
concat!(
"Offset of field: ",
stringify!(OrtApi),
"::",
stringify!(UpdateCUDAProviderOptions)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<OrtApi>())).GetCUDAProviderOptionsAsString as *const _ as usize
},
1656usize,
concat!(
"Offset of field: ",
stringify!(OrtApi),
"::",
stringify!(GetCUDAProviderOptionsAsString)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<OrtApi>())).ReleaseCUDAProviderOptions as *const _ as usize
},
1664usize,
concat!(
"Offset of field: ",
stringify!(OrtApi),
"::",
stringify!(ReleaseCUDAProviderOptions)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<OrtApi>())).SessionOptionsAppendExecutionProvider_MIGraphX
as *const _ as usize
},
1672usize,
concat!(
"Offset of field: ",
stringify!(OrtApi),
"::",
stringify!(SessionOptionsAppendExecutionProvider_MIGraphX)
)
);
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
Expand Down Expand Up @@ -6269,6 +6446,12 @@ extern "C" {
device_id: ::std::os::raw::c_int,
) -> OrtStatusPtr;
}
extern "C" {
pub fn OrtSessionOptionsAppendExecutionProvider_MIGraphX(
options: *mut OrtSessionOptions,
device_id: ::std::os::raw::c_int,
) -> OrtStatusPtr;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __locale_data {
Expand Down
Loading

0 comments on commit 9769ca3

Please sign in to comment.