Skip to content

Commit d807090

Browse files
committed
enable CPU extension features based on target in llama-cpp-2
1 parent d2ae876 commit d807090

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

llama-cpp-2/Cargo.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ cuda = ["llama-cpp-sys-2/cuda"]
1919
metal = ["llama-cpp-sys-2/metal"]
2020
sampler = []
2121

22+
[target.'cfg(target_feature = "avx")'.dependencies]
23+
llama-cpp-sys-2 = { path = "../llama-cpp-sys-2", features = ["avx"] }
24+
[target.'cfg(target_feature = "avx2")'.dependencies]
25+
llama-cpp-sys-2 = { path = "../llama-cpp-sys-2", features = ["avx2"] }
26+
[target.'cfg(target_feature = "avx512vbmi")'.dependencies]
27+
llama-cpp-sys-2 = { path = "../llama-cpp-sys-2", features = ["avx512_vmbi"] }
28+
[target.'cfg(target_feature = "avx512vnni")'.dependencies]
29+
llama-cpp-sys-2 = { path = "../llama-cpp-sys-2", features = ["avx512_vnni"] }
30+
[target.'cfg(target_feature = "f16c")'.dependencies]
31+
llama-cpp-sys-2 = { path = "../llama-cpp-sys-2", features = ["f16c"] }
32+
[target.'cfg(target_feature = "fma")'.dependencies]
33+
llama-cpp-sys-2 = { path = "../llama-cpp-sys-2", features = ["fma"] }
34+
2235
[target.'cfg(all(target_os = "macos", any(target_arch = "aarch64", target_arch = "arm64")))'.dependencies]
2336
llama-cpp-sys-2 = { path = "../llama-cpp-sys-2", features=["metal"], version = "0.1.48" }
2437

0 commit comments

Comments
 (0)