Skip to content

Commit

Permalink
Fix feature compilation for vector
Browse files Browse the repository at this point in the history
  • Loading branch information
mert-kurttutan committed Feb 1, 2025
1 parent aa5bf7f commit fd0beea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion candle-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions candle-core/src/op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fd0beea

Please sign in to comment.