Add an OpenBLAS feature
This commit is contained in:
parent
f79bc283d3
commit
99ebf2bea5
4 changed files with 20 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ simd = []
|
|||
coreml = ["whisper-rs-sys/coreml"]
|
||||
cuda = ["whisper-rs-sys/cuda"]
|
||||
opencl = ["whisper-rs-sys/opencl"]
|
||||
openblas = ["whisper-rs-sys/openblas"]
|
||||
test-with-tiny-model = []
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
|
|
|
|||
|
|
@ -100,3 +100,14 @@ impl Default for SystemInfo {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_openblas() {
|
||||
let info = SystemInfo::default();
|
||||
assert_eq!(info.blas, cfg!(feature = "openblas"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ include = [
|
|||
coreml = []
|
||||
cuda = []
|
||||
opencl = []
|
||||
openblas = []
|
||||
|
||||
[dependencies]
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@ fn main() {
|
|||
println!("cargo:rustc-link-lib=clblast");
|
||||
println!("cargo:rustc-link-lib=OpenCL");
|
||||
}
|
||||
#[cfg(feature = "openblas")]
|
||||
{
|
||||
println!("cargo:rustc-link-lib=openblas");
|
||||
}
|
||||
#[cfg(feature = "cuda")]
|
||||
{
|
||||
println!("cargo:rustc-link-lib=cublas");
|
||||
|
|
@ -109,6 +113,9 @@ fn main() {
|
|||
#[cfg(feature = "cuda")]
|
||||
cmd.arg("-DWHISPER_CUBLAS=ON");
|
||||
|
||||
#[cfg(feature = "openblas")]
|
||||
cmd.arg("-DWHISPER_OPENBLAS=ON");
|
||||
|
||||
#[cfg(feature = "opencl")]
|
||||
cmd.arg("-DWHISPER_CLBLAST=ON");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue