Skip to content

Commit

Permalink
refactor(transformer-cpu): 开启 mkl 支持,自动检测
Browse files Browse the repository at this point in the history
Signed-off-by: YdrMaster <[email protected]>
  • Loading branch information
YdrMaster committed Mar 21, 2024
1 parent 6286fea commit bcc8b68
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
13 changes: 7 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions transformer-cpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ tensor = { path = "../tensor" }
transformer = { path = "../transformer" }
gemm = "0.17"
intel-mkl-src = "0.8"

[build-dependencies]
intel-mkl-tool = "0.8"
7 changes: 5 additions & 2 deletions transformer-cpu/build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
fn main() {
// println!("cargo:rustc-cfg=detected_mkl");
// println!("cargo:rustc-link-lib=dylib=mkl_rt");
if !intel_mkl_tool::Library::available().is_empty() {
// **NOTICE** add mkl_rt to library search path
println!("cargo:rustc-cfg=detected_mkl");
println!("cargo:rustc-link-lib=dylib=mkl_rt");
}
}

0 comments on commit bcc8b68

Please sign in to comment.