Skip to content

Commit

Permalink
Fixed compilation issues on non-Apple platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
BhavyeMathur committed Dec 30, 2024
1 parent ab5c267 commit 8300de1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/accelerate/cblas.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(non_snake_case)]

use std::ffi::{c_double, c_float, c_int};

#[cfg(target_vendor = "apple")]
Expand Down
4 changes: 2 additions & 2 deletions src/tensor/data_buffer/fill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ where
fn fill(&self, value: T);
}

#[cfg(target_vendor = "apple")]
impl Fill<f32> for DataOwned<f32> {
#[cfg(target_vendor = "apple")]
fn fill(&self, value: f32) {
unsafe { catlas_sset(self.len as c_int, value, self.const_ptr(), 1) }
}
}

#[cfg(target_vendor = "apple")]
impl Fill<f64> for DataOwned<f64> {
#[cfg(target_vendor = "apple")]
fn fill(&self, value: f64) {
unsafe { catlas_dset(self.len as c_int, value, self.const_ptr(), 1) }
}
Expand Down
1 change: 1 addition & 0 deletions src/tensor/fill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ where
}
}

#[cfg(target_vendor = "apple")]
#[cfg(test)]
mod tests {
use crate::{FlatIterator, Tensor};
Expand Down

0 comments on commit 8300de1

Please sign in to comment.