diff --git a/rust/lance-linalg/build.rs b/rust/lance-linalg/build.rs index fee023cf742..20e4ebb1370 100644 --- a/rust/lance-linalg/build.rs +++ b/rust/lance-linalg/build.rs @@ -34,9 +34,20 @@ fn main() -> Result<(), String> { return Ok(()); } + if cfg!(not(feature = "fp16kernels")) { + println!( + "cargo:warning=fp16kernels feature is not enabled, skipping build of fp16 kernels" + ); + return Ok(()); + } + if target_arch == "aarch64" && target_os == "macos" { // Build a version with NEON build_f16_with_flags("neon", &["-mtune=apple-m1"]).unwrap(); + } else if target_arch == "aarch64" && target_os == "ios" { + // Build version with NEON + // A13 bionic is the earliest supported iOS SOC + build_f16_with_flags("neon", &["-mtune=apple-a13"]).unwrap(); } else if target_arch == "aarch64" && target_os == "linux" { // Build a version with NEON build_f16_with_flags("neon", &["-march=armv8.2-a+fp16"]).unwrap();