Add vulkan device list function.

This commit is contained in:
HidetoshiMatsuo 2025-05-13 14:19:45 +09:00
parent de30f9c23d
commit dac152cad4
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/")

View file

@ -1,2 +1,6 @@
#include <include/whisper.h>
#include <ggml/include/ggml.h>
#ifdef GGML_USE_VULKAN
#include "ggml-vulkan.h"
#endif