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 Aug 2, 2024
1 parent f9258f2 commit 7dd3638
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,27 @@ jobs:
components: rustfmt
- run: cargo fmt --all --check

nostd-build:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
include:
- rust: stable
experimental: false
target: thumbv6m-none-eabi

name: nostd-build/${{ matrix.target }}/${{ matrix.rust }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- name: Tests
run: |
cargo rustc "--target=${{ matrix.target }}" --no-default-features --features portable-atomic-critical-section
tests:
runs-on: ubuntu-latest
strategy:
Expand Down
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ 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" }


[dev-dependencies]
defmac = "0.2"
quickcheck = { version = "1.0", default-features = false }
Expand All @@ -70,8 +71,14 @@ docs = ["approx", "serde", "rayon"]
std = ["num-traits/std", "matrixmultiply/std"]
rayon = ["dep:rayon", "std"]

portable-atomic-critical-section = ["portable-atomic/critical-section"]

matrixmultiply-threading = ["matrixmultiply/threading"]

[target.'cfg(not(target_has_atomic = "ptr"))'.dependencies]
portable-atomic = { version = "1.6.0" }
portable-atomic-util = { version = "0.2.0", features = [ "alloc" ] }

[profile.bench]
debug = true
[profile.dev.package.numeric-tests]
Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ your `Cargo.toml`.

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

- ``portable-atomic-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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
#[allow(unused_imports)]
use rawpointer::PointerExt;

#[cfg(target_has_atomic = "ptr")]
use alloc::sync::Arc;

#[cfg(not(target_has_atomic = "ptr"))]
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/impl_arc_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
// except according to those terms.

use crate::imp_prelude::*;

#[cfg(target_has_atomic = "ptr")]
use alloc::sync::Arc;

#[cfg(not(target_has_atomic = "ptr"))]
use portable_atomic_util::Arc;

/// Methods specific to `ArcArray`.
///
/// ***See also all methods for [`ArrayBase`]***
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ extern crate cblas_sys;
#[cfg(feature = "docs")]
pub mod doc;

#[cfg(target_has_atomic = "ptr")]
use alloc::sync::Arc;

#[cfg(not(target_has_atomic = "ptr"))]
use portable_atomic_util::Arc;

use std::marker::PhantomData;

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

0 comments on commit 7dd3638

Please sign in to comment.