Merge pull request #227 from gn64/feature/vulkan_device_list

Add Vulkan GPU enumeration support (related to #160)
This commit is contained in:
Niko 2025-06-07 23:30:07 -07:00 committed by GitHub
commit f9cf5062bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 89 additions and 2 deletions

View file

@ -119,10 +119,18 @@ fn main() {
let _: u64 = std::fs::copy("src/bindings.rs", out.join("bindings.rs"))
.expect("Failed to copy bindings.rs");
} else {
let bindings = bindgen::Builder::default().header("wrapper.h");
let mut bindings = bindgen::Builder::default().header("wrapper.h");
#[cfg(feature = "metal")]
let bindings = bindings.header("whisper.cpp/ggml/include/ggml-metal.h");
{
bindings = bindings.header("whisper.cpp/ggml/include/ggml-metal.h");
}
#[cfg(feature = "vulkan")]
{
bindings = bindings
.header("whisper.cpp/ggml/include/ggml-vulkan.h")
.clang_arg("-DGGML_USE_VULKAN=1");
}
let bindings = bindings
.clang_arg("-I./whisper.cpp/")