Skip to content

Commit

Permalink
Upgrade to ispc 1.1.0 with cleaned up bindings file
Browse files Browse the repository at this point in the history
`ispc_compile` can now be configured to omit irrelevant bindings from
the bindings file and leave only the function(s) in place that are
relevant to interface with the ISPC kernel
(Twinklebear/ispc-rs#20).  This makes the file
less busy/noisy, and it won't change when regenerating across OS-es
anymore.
  • Loading branch information
MarijnS95 committed Jun 30, 2022
1 parent 41552ce commit bd7f72a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 61 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ include = [
]

[dependencies]
ispc_rt = "1.0.7"
ispc_rt = "1.1"

[build-dependencies]
ispc_compile = { version = "1.0.4", optional = true }
ispc_rt = "1.0.7"
ispc_compile = { version = "1.1", optional = true }
ispc_rt = "1.1"

[dev-dependencies]
image = "0.24.1"
Expand Down
7 changes: 5 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#[cfg(feature = "ispc")]
fn compile_bindings() {
use ispc_compile::{MathLib, TargetISA, TargetOS};
use ispc_compile::{BindgenOptions, Config, MathLib, TargetISA};

// Compile our ISPC library, this call will exit with EXIT_FAILURE if
// compilation fails.

ispc_compile::Config::new()
Config::new()
.file("src/ispc/kernels/lanczos3.ispc")
.opt_level(2)
.woff()
Expand All @@ -18,6 +18,9 @@ fn compile_bindings() {
TargetISA::AVX512SKXi32x16,
])
.math_lib(MathLib::Fast)
.bindgen_options(BindgenOptions {
allowlist_functions: vec!["resample".into()],
})
.out_dir("src/ispc")
.compile("downsample_ispc");
}
Expand Down
58 changes: 2 additions & 56 deletions src/ispc/downsample_ispc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,8 @@
pub mod downsample_ispc {
/* automatically generated by rust-bindgen 0.59.2 */

pub const _VCRT_COMPILER_PREPROCESSOR: u32 = 1;
pub const _SAL_VERSION: u32 = 20;
pub const __SAL_H_VERSION: u32 = 180000000;
pub const _USE_DECLSPECS_FOR_SAL: u32 = 0;
pub const _USE_ATTRIBUTES_FOR_SAL: u32 = 0;
pub const _CRT_PACKING: u32 = 8;
pub const _HAS_EXCEPTIONS: u32 = 1;
pub const _STL_LANG: u32 = 0;
pub const _HAS_CXX17: u32 = 0;
pub const _HAS_CXX20: u32 = 0;
pub const _HAS_CXX23: u32 = 0;
pub const _HAS_NODISCARD: u32 = 0;
pub const WCHAR_MIN: u32 = 0;
pub const WCHAR_MAX: u32 = 65535;
pub const WINT_MIN: u32 = 0;
pub const WINT_MAX: u32 = 65535;
pub const true_: u32 = 1;
pub const false_: u32 = 0;
pub const __bool_true_false_are_defined: u32 = 1;
pub type va_list = *mut ::std::os::raw::c_char;
extern "C" {
pub fn __va_start(arg1: *mut *mut ::std::os::raw::c_char, ...);
}
pub type size_t = ::std::os::raw::c_ulonglong;
pub type __vcrt_bool = bool;
pub type wchar_t = ::std::os::raw::c_ushort;
extern "C" {
pub fn __security_init_cookie();
}
extern "C" {
pub fn __security_check_cookie(_StackCookie: usize);
}
extern "C" {
pub fn __report_gsfailure(_StackCookie: usize);
}
extern "C" {
pub static mut __security_cookie: usize;
}
pub type int_least8_t = ::std::os::raw::c_schar;
pub type int_least16_t = ::std::os::raw::c_short;
pub type int_least32_t = ::std::os::raw::c_int;
pub type int_least64_t = ::std::os::raw::c_longlong;
pub type uint_least8_t = ::std::os::raw::c_uchar;
pub type uint_least16_t = ::std::os::raw::c_ushort;
pub type uint_least32_t = ::std::os::raw::c_uint;
pub type uint_least64_t = ::std::os::raw::c_ulonglong;
pub type int_fast8_t = ::std::os::raw::c_schar;
pub type int_fast16_t = ::std::os::raw::c_int;
pub type int_fast32_t = ::std::os::raw::c_int;
pub type int_fast64_t = ::std::os::raw::c_longlong;
pub type uint_fast8_t = ::std::os::raw::c_uchar;
pub type uint_fast16_t = ::std::os::raw::c_uint;
pub type uint_fast32_t = ::std::os::raw::c_uint;
pub type uint_fast64_t = ::std::os::raw::c_ulonglong;
pub type intmax_t = ::std::os::raw::c_longlong;
pub type uintmax_t = ::std::os::raw::c_ulonglong;
pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __uint32_t = ::std::os::raw::c_uint;
extern "C" {
pub fn resample(
width: u32,
Expand Down
Binary file modified src/ispc/libdownsample_ispcx86_64-unknown-linux-gnu.a
Binary file not shown.

0 comments on commit bd7f72a

Please sign in to comment.