diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 0000000..b6febfe --- /dev/null +++ b/.cargo/config @@ -0,0 +1,2 @@ +[build] +rustflags = ["-C", "target-feature=+avx2,+avx,+sse,+fma"] diff --git a/src/main.rs b/src/main.rs index 1fe1682..c612460 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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> { rllama::rllama_main::main() }