Update level0 to 1.0 and unpack fatbins

This commit is contained in:
Andrzej Janik 2020-08-28 22:37:16 +02:00
commit 34dc149be1
17 changed files with 8112 additions and 4753 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "level_zero-sys"
version = "0.91.0"
version = "1.0.4"
authors = ["Andrzej Janik <vosen@vosen.pl>"]
edition = "2018"
links = "ze_loader"

View file

@ -1 +1,4 @@
bindgen --size_t-is-usize --default-enum-style=rust --whitelist-function ze.* /usr/include/level_zero/zex_api.h -o zex_api.rs -- -x c++ && sed -i 's/pub enum _ze_result_t/#[must_use]\npub enum _ze_result_t/g' zex_api.rs
sed 's/^typedef uint32_t ze_.*flags_t;$//g' /usr/local/include/level_zero/ze_api.h > ze_api.h
sed -i -r 's/ze_(.*)_flag_t/ze_\1_flags_t/g' ze_api.h
bindgen --size_t-is-usize --default-enum-style=newtype --bitfield-enum ".*flags_t" --whitelist-function "ze.*" ze_api.h -o ze_api.rs
sed -i 's/pub struct _ze_result_t/#[must_use]\npub struct _ze_result_t/g' ze_api.rs

View file

@ -1,7 +1,18 @@
use env::VarError;
use std::{env, path::PathBuf};
fn main() {
fn main() -> Result<(), VarError> {
println!("cargo:rustc-link-lib=dylib=ze_loader");
// TODO: make this windows-only
println!("cargo:rustc-link-search=native=C:\\Windows\\System32");
if env::var("CARGO_CFG_WINDOWS").is_ok() {
let env = env::var("CARGO_CFG_TARGET_ENV")?;
if env == "gnu" {
println!("cargo:rustc-link-search=native=C:\\Windows\\System32");
} else {
let mut path = PathBuf::from(env::var("CARGO_MANIFEST_DIR")?);
path.push("src");
println!("cargo:rustc-link-search=native={}", path.display());
};
}
println!("cargo:rerun-if-changed=build.rs");
}
Ok(())
}

File diff suppressed because it is too large Load diff

Binary file not shown.