Browse Source

refactor: remove sve feature flag

km/mkdocs-impl
Bobbin Threadbare 1 year ago
committed by Bobbin Threadbare
parent
commit
457c985a92
4 changed files with 6 additions and 7 deletions
  1. +0
    -1
      Cargo.toml
  2. +2
    -2
      README.md
  3. +2
    -2
      build.rs
  4. +2
    -2
      src/hash/rescue/arch/mod.rs

+ 0
- 1
Cargo.toml

@ -36,7 +36,6 @@ default = ["std"]
executable = ["dep:clap", "dep:rand_utils", "std"]
serde = ["dep:serde", "serde?/alloc", "winter_math/serde"]
std = ["blake3/std", "dep:cc", "dep:libc", "winter_crypto/std", "winter_math/std", "winter_utils/std"]
sve = ["std"]
[dependencies]
blake3 = { version = "1.5", default-features = false }

+ 2
- 2
README.md

@ -53,9 +53,9 @@ RUSTFLAGS="-C target-feature=+avx2" cargo build --release
```
### SVE acceleration
On platforms with [SVE](https://en.wikipedia.org/wiki/AArch64#Scalable_Vector_Extension_(SVE)) support, RPO and RPX hash function can be accelerated by using the vector processing unit. To enable SVE acceleration, the code needs to be compiled with the `sve` feature enabled. This feature has an effect only if the platform exposes `target-feature=sve` flag. On some platforms (e.g., Graviton 3), for this flag to be set, the compilation must be done in "native" mode. For example, to enable SVE acceleration on Graviton 3, we can execute the following:
On platforms with [SVE](https://en.wikipedia.org/wiki/AArch64#Scalable_Vector_Extension_(SVE)) support, RPO and RPX hash function can be accelerated by using the vector processing unit. To enable SVE acceleration, the code needs to be compiled with the `sve` target feature enabled. For example:
```shell
RUSTFLAGS="-C target-cpu=native" cargo build --release --features sve
RUSTFLAGS="-C target-feature=+sve" cargo build --release
```
## Testing

+ 2
- 2
build.rs

@ -2,7 +2,7 @@ fn main() {
#[cfg(feature = "std")]
compile_rpo_falcon();
#[cfg(all(target_feature = "sve", feature = "sve"))]
#[cfg(target_feature = "sve")]
compile_arch_arm64_sve();
}
@ -34,7 +34,7 @@ fn compile_rpo_falcon() {
.compile("rpo_falcon512");
}
#[cfg(all(target_feature = "sve", feature = "sve"))]
#[cfg(target_feature = "sve")]
fn compile_arch_arm64_sve() {
const RPO_SVE_PATH: &str = "arch/arm64-sve/rpo";

+ 2
- 2
src/hash/rescue/arch/mod.rs

@ -1,4 +1,4 @@
#[cfg(all(target_feature = "sve", feature = "sve"))]
#[cfg(target_feature = "sve")]
pub mod optimized {
use crate::hash::rescue::STATE_WIDTH;
use crate::Felt;
@ -78,7 +78,7 @@ pub mod optimized {
}
}
#[cfg(not(any(target_feature = "avx2", all(target_feature = "sve", feature = "sve"))))]
#[cfg(not(any(target_feature = "avx2", target_feature = "sve")))]
pub mod optimized {
use crate::hash::rescue::STATE_WIDTH;
use crate::Felt;

Loading…
Cancel
Save