Skip to content

Commit

Permalink
feat: Add .S files as well
Browse files Browse the repository at this point in the history
  • Loading branch information
uttarayan21 committed Nov 13, 2024
1 parent 00131e1 commit fb1140b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions mnn-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -761,12 +761,13 @@ fn x86_64<'a>(
build.define("MNN_USE_SSE", None);
let x86_src_dir = x86_64_dir.as_ref();
let mnn_x8664_src = read_dir(&x86_src_dir).filter(|p| cpp_filter(p));
let mnn_avx_src = read_dir(x86_src_dir.join("avx")).filter(|p| cpp_filter(p));
let mnn_avxfma_src = read_dir(x86_src_dir.join("avxfma")).filter(|p| cpp_filter(p));
let mnn_avx_src = read_dir(x86_src_dir.join("avx")).filter(|p| cpp_filter(p) || asm_filter(p));
let mnn_avxfma_src =
read_dir(x86_src_dir.join("avxfma")).filter(|p| cpp_filter(p) || asm_filter(p));
let mnn_sse_src = read_dir(x86_src_dir.join("sse")).filter(|p| cpp_filter(p));
let mnn_avx512_vnni_src = x86_src_dir.join("avx512/GemmInt8_VNNI.cpp");
let mnn_avx512_src = read_dir(x86_src_dir.join("avx512"))
.filter(|p| cpp_filter(p))
.filter(|p| cpp_filter(p) || asm_filter(p))
.filter(|p| p != &mnn_avx512_vnni_src);

if has_avx512 && CxxOption::AVX512.enabled() && (!like_msvc || win_use_asm) {
Expand Down Expand Up @@ -921,3 +922,8 @@ int main() {return 0;} "#;
fn cpp_filter(path: impl AsRef<Path>) -> bool {
path.as_ref().extension() == Some(OsStr::new("cpp"))
}

fn asm_filter(path: impl AsRef<Path>) -> bool {
path.as_ref().extension() == Some(OsStr::new("S"))
|| path.as_ref().extension() == Some(OsStr::new("s"))
}

0 comments on commit fb1140b

Please sign in to comment.