Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made compatible with thumbv6m-none-eabi #1384

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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}
BjornTheProgrammer marked this conversation as resolved.
Show resolved Hide resolved

[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