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

fix: remove stdsimd feature; add stdarch_x86_avx512 #62

Merged
merged 7 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions benches/bench_f16_ignore_nan.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(stdsimd)]

use argminmax::ArgMinMax;
use codspeed_criterion_compat::*;
use dev_utils::{config, utils};
Expand Down
2 changes: 0 additions & 2 deletions benches/bench_f16_return_nan.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(stdsimd)]

use argminmax::NaNArgMinMax;
use codspeed_criterion_compat::*;
use dev_utils::{config, utils};
Expand Down
2 changes: 0 additions & 2 deletions benches/bench_f32_ignore_nan.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(stdsimd)]

use argminmax::ArgMinMax;
use codspeed_criterion_compat::*;
use dev_utils::{config, utils};
Expand Down
2 changes: 0 additions & 2 deletions benches/bench_f32_return_nan.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(stdsimd)]

use argminmax::NaNArgMinMax;
use codspeed_criterion_compat::*;
use dev_utils::{config, utils};
Expand Down
2 changes: 0 additions & 2 deletions benches/bench_f64_ignore_nan.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(stdsimd)]

use argminmax::ArgMinMax;
use codspeed_criterion_compat::*;
use dev_utils::{config, utils};
Expand Down
2 changes: 0 additions & 2 deletions benches/bench_f64_return_nan.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(stdsimd)]

use argminmax::NaNArgMinMax;
use codspeed_criterion_compat::*;
use dev_utils::{config, utils};
Expand Down
2 changes: 0 additions & 2 deletions benches/bench_i16.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(stdsimd)]

use argminmax::ArgMinMax;
use codspeed_criterion_compat::*;
use dev_utils::{config, utils};
Expand Down
2 changes: 0 additions & 2 deletions benches/bench_i32.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(stdsimd)]

use argminmax::ArgMinMax;
use codspeed_criterion_compat::*;
use dev_utils::{config, utils};
Expand Down
2 changes: 0 additions & 2 deletions benches/bench_i64.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(stdsimd)]

use argminmax::ArgMinMax;
use codspeed_criterion_compat::*;
use dev_utils::{config, utils};
Expand Down
2 changes: 0 additions & 2 deletions benches/bench_i8.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(stdsimd)]

use argminmax::ArgMinMax;
use codspeed_criterion_compat::*;
use dev_utils::{config, utils};
Expand Down
2 changes: 0 additions & 2 deletions benches/bench_u16.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(stdsimd)]

use argminmax::ArgMinMax;
use codspeed_criterion_compat::*;
use dev_utils::{config, utils};
Expand Down
2 changes: 0 additions & 2 deletions benches/bench_u32.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(stdsimd)]

use argminmax::ArgMinMax;
use codspeed_criterion_compat::*;
use dev_utils::{config, utils};
Expand Down
2 changes: 0 additions & 2 deletions benches/bench_u64.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(stdsimd)]

use argminmax::ArgMinMax;
use codspeed_criterion_compat::*;
use dev_utils::{config, utils};
Expand Down
2 changes: 0 additions & 2 deletions benches/bench_u8.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(stdsimd)]

use argminmax::ArgMinMax;
use codspeed_criterion_compat::*;
use dev_utils::{config, utils};
Expand Down
27 changes: 25 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,31 @@
//!```
//!

// enable SIMD nightly features when on nightly_simd enabled
#![cfg_attr(feature = "nightly_simd", feature(stdsimd))]
// Enable SIMD nightly features when on nightly_simd enabled
#![cfg_attr(feature = "nightly_simd", feature(cfg_version))]
// ------- version 1.78 and above
#![cfg_attr(
all(
feature = "nightly_simd",
any(target_arch = "x86_64", target_arch = "x86")
),
cfg_attr(version("1.78"), feature(stdarch_x86_avx512))
)]
// TODO: Aarch64 is stable now - check if this is under nightly_simd https://github.com/rust-lang/rust/issues/111800
#![cfg_attr(
all(feature = "nightly_simd", target_arch = "arm"),
cfg_attr(
version("1.78"),
feature(stdarch_arm_neon_intrinsics),
feature(stdarch_arm_feature_detection)
)
)]
// ------- version 1.77 and below
#![cfg_attr(
feature = "nightly_simd",
cfg_attr(not(version("1.78")), feature(stdsimd))
)]
// ------- any version
#![cfg_attr(feature = "nightly_simd", feature(avx512_target_feature))]
#![cfg_attr(feature = "nightly_simd", feature(arm_target_feature))]

Expand Down
Loading