Don't let the crate be built without avx2, avx, etc. or it'll be very slow.

master
Mikko Juola 3 years ago
parent f2c38a272f
commit ebdea727fd

@ -0,0 +1,2 @@
[build]
rustflags = ["-C", "target-feature=+avx2,+avx,+sse,+fma"]

@ -1,3 +1,12 @@
#[cfg(not(target_feature = "avx2"))]
compile_error!("This library assumes availability of AVX and must be compiled with -C target-feature=+sse2,+avx,+fma,+avx2");
#[cfg(not(target_feature = "sse2"))]
compile_error!("This library assumes availability of AVX and must be compiled with -C target-feature=+sse2,+avx,+fma,+avx2");
#[cfg(not(target_feature = "fma"))]
compile_error!("This library assumes availability of AVX and must be compiled with -C target-feature=+sse2,+avx,+fma,+avx2");
#[cfg(not(target_feature = "avx"))]
compile_error!("This library assumes availability of AVX and must be compiled with -C target-feature=+sse2,+avx,+fma,+avx2");
pub fn main() -> Result<(), Box<dyn std::error::Error>> {
rllama::rllama_main::main()
}

Loading…
Cancel
Save