From fd0beea86f1ec740247391960ea91a946c914044 Mon Sep 17 00:00:00 2001 From: mert-kurttutan Date: Sat, 1 Feb 2025 17:01:14 +0000 Subject: [PATCH] Fix feature compilation for vector --- candle-core/src/lib.rs | 2 +- candle-core/src/op.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/candle-core/src/lib.rs b/candle-core/src/lib.rs index e85c4ecf49..e647f9527a 100644 --- a/candle-core/src/lib.rs +++ b/candle-core/src/lib.rs @@ -70,7 +70,7 @@ pub mod layout; pub mod metal_backend; #[cfg(feature = "mkl")] mod mkl; -#[cfg(not(all(feature = "mkl", feature = "accelerate")))] +#[cfg(not(any(feature = "mkl", feature = "accelerate")))] mod mathfun; pub mod npy; pub mod op; diff --git a/candle-core/src/op.rs b/candle-core/src/op.rs index 26998e5eb3..c0076e23ad 100644 --- a/candle-core/src/op.rs +++ b/candle-core/src/op.rs @@ -321,7 +321,7 @@ macro_rules! bin_op { crate::accelerate::$f64_vec(xs1, xs2, ys) } - #[cfg(all(not(feature = "mkl"), not(feature = "accelerate")))] + #[cfg(not(any(feature = "mkl", feature = "accelerate")))] #[inline(always)] fn f32_vec(xs1: &[f32], xs2: &[f32], ys: &mut [f32]) { crate::mathfun::$f32_vec(xs1, xs2, ys) @@ -448,7 +448,7 @@ macro_rules! unary_op { crate::accelerate::$f64_vec(xs, ys) } - #[cfg(all(not(feature = "mkl"), not(feature = "accelerate")))] + #[cfg(not(any(feature = "mkl", feature = "accelerate")))] #[inline(always)] fn f32_vec(xs: &[f32], ys: &mut [f32]) { crate::mathfun::$f32_vec(xs, ys) @@ -556,7 +556,7 @@ impl UnaryOpT for Gelu { crate::accelerate::vd_gelu(xs, ys) } - #[cfg(all(not(feature = "mkl"), not(feature = "accelerate")))] + #[cfg(not(any(feature = "mkl", feature = "accelerate")))] #[inline(always)] fn f32_vec(xs: &[f32], ys: &mut [f32]) { crate::mathfun::vs_gelu(xs, ys) @@ -665,7 +665,7 @@ impl UnaryOpT for Silu { crate::accelerate::vd_silu(xs, ys) } - #[cfg(all(not(feature = "mkl"), not(feature = "accelerate")))] + #[cfg(not(any(feature = "mkl", feature = "accelerate")))] #[inline(always)] fn f32_vec(xs: &[f32], ys: &mut [f32]) { crate::mathfun::vs_silu(xs, ys)