Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
2cdb117101
4 changed files with 33 additions and 7 deletions
|
|
@ -17,6 +17,7 @@ repository = "https://codeberg.org/tazz4843/whisper-rs"
|
|||
whisper-rs-sys = { path = "sys", version = "0.13" }
|
||||
log = { version = "0.4", optional = true }
|
||||
tracing = { version = "0.1", optional = true }
|
||||
libc = { version = "0.2", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
hound = "3.5.0"
|
||||
|
|
@ -31,8 +32,9 @@ cuda = ["whisper-rs-sys/cuda", "_gpu"]
|
|||
hipblas = ["whisper-rs-sys/hipblas", "_gpu"]
|
||||
openblas = ["whisper-rs-sys/openblas"]
|
||||
metal = ["whisper-rs-sys/metal", "_gpu"]
|
||||
vulkan = ["whisper-rs-sys/vulkan", "_gpu"]
|
||||
vulkan = ["whisper-rs-sys/vulkan", "_gpu", "dep:libc"]
|
||||
openmp = ["whisper-rs-sys/openmp"]
|
||||
intel-sycl = ["whisper-rs-sys/intel-sycl", "_gpu"]
|
||||
_gpu = []
|
||||
test-with-tiny-model = []
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ pub fn list_devices() -> Vec<VkDeviceInfo> {
|
|||
(0..n)
|
||||
.map(|id| {
|
||||
// 256 bytes is plenty (spec says 128 is enough)
|
||||
let mut tmp = [0i8; 256];
|
||||
let mut tmp: [libc::c_char; 256] = [0; 256];
|
||||
ggml_backend_vk_get_device_description(id as c_int, tmp.as_mut_ptr(), tmp.len());
|
||||
let mut free = 0usize;
|
||||
let mut total = 0usize;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ metal = []
|
|||
vulkan = []
|
||||
force-debug = []
|
||||
openmp = []
|
||||
intel-sycl = []
|
||||
|
||||
[build-dependencies]
|
||||
cmake = "0.1"
|
||||
|
|
|
|||
23
sys/build.rs
23
sys/build.rs
|
|
@ -267,21 +267,40 @@ fn main() {
|
|||
config.define("GGML_OPENMP", "OFF");
|
||||
}
|
||||
|
||||
if cfg!(feature = "intel-sycl") {
|
||||
config.define("BUILD_SHARED_LIBS", "ON");
|
||||
config.define("GGML_SYCL", "ON");
|
||||
config.define("GGML_SYCL_TARGET", "INTEL");
|
||||
config.define("CMAKE_C_COMPILER", "icx");
|
||||
config.define("CMAKE_CXX_COMPILER", "icpx");
|
||||
}
|
||||
|
||||
let destination = config.build();
|
||||
|
||||
add_link_search_path(&out.join("build")).unwrap();
|
||||
|
||||
println!("cargo:rustc-link-search=native={}", destination.display());
|
||||
if cfg!(feature = "intel-sycl") {
|
||||
println!("cargo:rustc-link-lib=whisper");
|
||||
println!("cargo:rustc-link-lib=ggml");
|
||||
println!("cargo:rustc-link-lib=ggml-base");
|
||||
println!("cargo:rustc-link-lib=ggml-cpu");
|
||||
} else {
|
||||
println!("cargo:rustc-link-lib=static=whisper");
|
||||
println!("cargo:rustc-link-lib=static=ggml");
|
||||
println!("cargo:rustc-link-lib=static=ggml-base");
|
||||
println!("cargo:rustc-link-lib=static=ggml-cpu");
|
||||
}
|
||||
if cfg!(target_os = "macos") || cfg!(feature = "openblas") {
|
||||
println!("cargo:rustc-link-lib=static=ggml-blas");
|
||||
}
|
||||
if cfg!(feature = "vulkan") {
|
||||
if cfg!(feature = "intel-sycl") {
|
||||
println!("cargo:rustc-link-lib=ggml-vulkan");
|
||||
} else {
|
||||
println!("cargo:rustc-link-lib=static=ggml-vulkan");
|
||||
}
|
||||
}
|
||||
|
||||
if cfg!(feature = "hipblas") {
|
||||
println!("cargo:rustc-link-lib=static=ggml-hip");
|
||||
|
|
@ -299,6 +318,10 @@ fn main() {
|
|||
println!("cargo:rustc-link-lib=static=ggml-blas");
|
||||
}
|
||||
|
||||
if cfg!(feature = "intel-sycl") {
|
||||
println!("cargo:rustc-link-lib=ggml-sycl");
|
||||
}
|
||||
|
||||
println!(
|
||||
"cargo:WHISPER_CPP_VERSION={}",
|
||||
get_whisper_cpp_version(&whisper_root)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue