diff --git a/.github/workflows/concrete_cpu_test.yml b/.github/workflows/concrete_cpu_test.yml index 0fd322c7f..87a8a2ae5 100644 --- a/.github/workflows/concrete_cpu_test.yml +++ b/.github/workflows/concrete_cpu_test.yml @@ -7,7 +7,7 @@ on: env: CARGO_TERM_COLOR: always jobs: - tests: + tests-linux: runs-on: ubuntu-20.04 env: RUSTFLAGS: -D warnings @@ -60,3 +60,63 @@ jobs: run: | cd backends/concrete-cpu/test make test + + tests-mac_x86: + runs-on: macos-11 + env: + RUSTFLAGS: -D warnings + steps: + - uses: actions/checkout@v3 + + - name: Rust install + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: Download cargo cache + uses: Swatinem/rust-cache@v2 + + - name: Tests + run: | + cd backends/concrete-cpu + cargo test --no-fail-fast --all-targets + + - name: Zig install + run: | + brew install zig + + - name: Zig test + run: | + cd backends/concrete-cpu/test + make test + + + tests-mac-m1: + runs-on: m1mac + env: + RUSTFLAGS: -D warnings + steps: + - uses: actions/checkout@v3 + + - name: Rust install + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + + - name: Download cargo cache + uses: Swatinem/rust-cache@v2 + + - name: Tests + run: | + cd backends/concrete-cpu + cargo test --no-fail-fast --all-targets + + - name: Zig install + run: | + brew install zig + + - name: Zig test + run: | + cd backends/concrete-cpu/test + make test diff --git a/backends/concrete-cpu/src/c_api/csprng.rs b/backends/concrete-cpu/src/c_api/csprng.rs index c3eadf0b5..e86c2c65a 100644 --- a/backends/concrete-cpu/src/c_api/csprng.rs +++ b/backends/concrete-cpu/src/c_api/csprng.rs @@ -68,6 +68,7 @@ pub unsafe extern "C" fn concrete_cpu_destroy_concrete_csprng(mem: *mut Csprng) // Returns 1 if the random is crypto secure, -1 if it not secure, 0 if fail. #[no_mangle] pub unsafe extern "C" fn concrete_cpu_crypto_secure_random_128(u128: *mut Uint128) -> c_int { + #[cfg(any(target_arch = "x86_64", target_arch = "x86"))] if is_x86_feature_detected!("rdseed") { let mut rand: u64 = 0; loop { diff --git a/backends/concrete-cpu/src/implementation/convert/mod.rs b/backends/concrete-cpu/src/implementation/convert/mod.rs index 85664f646..7666497d2 100644 --- a/backends/concrete-cpu/src/implementation/convert/mod.rs +++ b/backends/concrete-cpu/src/implementation/convert/mod.rs @@ -10,6 +10,7 @@ use core::mem::MaybeUninit; use dyn_stack::{DynStack, SizeOverflow, StackReq}; use pulp::{as_arrays, as_arrays_mut}; +#[cfg(any(target_arch = "x86_64", target_arch = "x86"))] pub mod x86; fn convert_forward_integer_u64_scalar(