Skip to content

Commit 2cc0aaa

Browse files
author
haixuanTao
committed
Adding Windows bindings
2 parents 3dff319 + 250035d commit 2cc0aaa

File tree

2 files changed

+30
-13
lines changed

2 files changed

+30
-13
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ Generate the bindings:
242242
```sh
243243
❯ docker exec -it --user "$(id -u)":"$(id -g)" rustbuilder /bin/bash
244244
cd onnxruntime-sys
245-
❯ cargo build --features generate-bindings
245+
❯ cargo build --features 'generate-bindings, cuda'
246246
```
247247

248248
### Generating Bindings for Windows With Vagrant
@@ -255,8 +255,8 @@ Windows can build both x86 and x86_64 bindings:
255255
```sh
256256
❯ rustup target add i686-pc-windows-msvc x86_64-pc-windows-msvc
257257
cd onnxruntime-sys
258-
❯ cargo build --features generate-bindings --target i686-pc-windows-msvc
259-
❯ cargo build --features generate-bindings --target x86_64-pc-windows-msvc
258+
❯ cargo build --features 'generate-bindings, cuda' --target i686-pc-windows-msvc
259+
❯ cargo build --features 'generate-bindings, cuda' --target x86_64-pc-windows-msvc
260260
```
261261

262262
## Conduct

onnxruntime-sys/src/generated/windows/x86_64/bindings.rs

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,21 @@ extern "C" {
476476
_Alignment: usize,
477477
) -> *mut ::std::os::raw::c_void;
478478
}
479-
pub type max_align_t = f64;
479+
extern "C" {
480+
pub fn _errno() -> *mut ::std::os::raw::c_int;
481+
}
482+
extern "C" {
483+
pub fn _set_errno(_Value: ::std::os::raw::c_int) -> errno_t;
484+
}
485+
extern "C" {
486+
pub fn _get_errno(_Value: *mut ::std::os::raw::c_int) -> errno_t;
487+
}
488+
extern "C" {
489+
pub fn __threadid() -> ::std::os::raw::c_ulong;
490+
}
491+
extern "C" {
492+
pub fn __threadhandle() -> usize;
493+
}
480494
pub type _CoreCrtSecureSearchSortCompareFunction = ::std::option::Option<
481495
unsafe extern "C" fn(
482496
arg1: *mut ::std::os::raw::c_void,
@@ -975,15 +989,6 @@ extern "C" {
975989
extern "C" {
976990
pub fn _set_error_mode(_Mode: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
977991
}
978-
extern "C" {
979-
pub fn _errno() -> *mut ::std::os::raw::c_int;
980-
}
981-
extern "C" {
982-
pub fn _set_errno(_Value: ::std::os::raw::c_int) -> errno_t;
983-
}
984-
extern "C" {
985-
pub fn _get_errno(_Value: *mut ::std::os::raw::c_int) -> errno_t;
986-
}
987992
extern "C" {
988993
pub fn __doserrno() -> *mut ::std::os::raw::c_ulong;
989994
}
@@ -6626,6 +6631,18 @@ fn bindgen_test_layout_OrtCustomOp() {
66266631
)
66276632
);
66286633
}
6634+
extern "C" {
6635+
pub fn OrtSessionOptionsAppendExecutionProvider_CPU(
6636+
options: *mut OrtSessionOptions,
6637+
use_arena: ::std::os::raw::c_int,
6638+
) -> OrtStatusPtr;
6639+
}
6640+
extern "C" {
6641+
pub fn OrtSessionOptionsAppendExecutionProvider_CUDA(
6642+
options: *mut OrtSessionOptions,
6643+
device_id: ::std::os::raw::c_int,
6644+
) -> OrtStatusPtr;
6645+
}
66296646
#[repr(C)]
66306647
#[derive(Debug, Copy, Clone)]
66316648
pub struct __crt_locale_data {

0 commit comments

Comments
 (0)