Skip to content

Commit

Permalink
Made compatible with thumbv6m-none-eabi
Browse files Browse the repository at this point in the history
  • Loading branch information
BjornTheProgrammer committed Apr 28, 2024
1 parent f5d17e5 commit 5ede2f9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Cargo.toml
Expand Up @@ -45,6 +45,9 @@ matrixmultiply = { version = "0.3.2", default-features = false, features=["cgemm
serde = { version = "1.0", optional = true, default-features = false, features = ["alloc"] }
rawpointer = { version = "0.2" }

portable-atomic = { git = "https://github.com/taiki-e/portable-atomic.git", rev = "4e66bd3", optional = true }
portable-atomic-util = { git = "https://github.com/taiki-e/portable-atomic.git", rev = "4e66bd3", features = ["alloc"], optional = true}

[dev-dependencies]
defmac = "0.2"
quickcheck = { version = "1.0", default-features = false }
Expand All @@ -70,6 +73,9 @@ docs = ["approx", "serde", "rayon"]
std = ["num-traits/std", "matrixmultiply/std"]
rayon = ["rayon_", "std"]

portable-atomic = ["dep:portable-atomic", "dep:portable-atomic-util"]
critical-section = ["portable-atomic/critical-section"]

matrixmultiply-threading = ["matrixmultiply/threading"]

[profile.bench]
Expand Down
8 changes: 8 additions & 0 deletions README.rst
Expand Up @@ -97,6 +97,14 @@ your `Cargo.toml`.

- Enable the ``threading`` feature in the matrixmultiply package

- ``portable-atomic``

- Enables ``portable_atomic`` package for compatability with microcontrollers

- ``critical-section``

- Whether ``portable_atomic`` should use ``critical-section``

How to use with cargo
---------------------

Expand Down
5 changes: 5 additions & 0 deletions src/data_traits.rs
Expand Up @@ -10,7 +10,12 @@

use rawpointer::PointerExt;

#[cfg(not(feature = "portable-atomic"))]
use alloc::sync::Arc;

#[cfg(feature = "portable-atomic")]
use portable_atomic_util::Arc;

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use std::mem::MaybeUninit;
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Expand Up @@ -124,7 +124,12 @@ extern crate cblas_sys;
#[cfg(feature = "docs")]
pub mod doc;

#[cfg(not(feature = "portable-atomic"))]
use alloc::sync::Arc;

#[cfg(feature = "portable-atomic")]
use portable_atomic_util::Arc;

use std::marker::PhantomData;

pub use crate::dimension::dim::*;
Expand Down

0 comments on commit 5ede2f9

Please sign in to comment.