Skip to content

Commit

Permalink
example is only for x86-64
Browse files Browse the repository at this point in the history
  • Loading branch information
hkratz committed Jun 18, 2021
1 parent b6304c2 commit 7fea546
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions examples/streaming.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#[cfg(feature = "public_imp")]
use simdutf8::basic::imp::Utf8Validator;

#[allow(unused_imports)]
use std::io::{stdin, Read, Result};

#[cfg(feature = "public_imp")]
#[cfg(all(feature = "public_imp", target_arch = "x86_64"))]
fn main() -> Result<()> {
use simdutf8::basic::imp::Utf8Validator;
unsafe {
if !std::is_x86_feature_detected!("avx2") {
panic!("This example only works with CPUs supporting AVX 2");
Expand All @@ -32,5 +30,5 @@ fn main() -> Result<()> {
}

/// Dummy main. This example requires the crate feature `public_imp`.
#[cfg(not(feature = "public_imp"))]
#[cfg(not(all(feature = "public_imp", target_arch = "x86_64")))]
fn main() {}

0 comments on commit 7fea546

Please sign in to comment.