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

♻️ parameterize tests #31

Merged
merged 3 commits into from
Feb 28, 2023
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
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ arrow = { version = ">0", default-features = false, optional = true}
default = ["half"] # TODO: remove this as default feature as soon as https://github.com/CodSpeedHQ/codspeed-rust/issues/1 is fixed

[dev-dependencies]
# rstest = { version = "0.16", default-features = false}
# rstest_reuse = "0.5"
rstest = { version = "0.16", default-features = false }
rstest_reuse = { version = "0.5", default-features = false }
rand = { version = "0.7.2", default-features = false }
codspeed-criterion-compat = "1.0.1"
criterion = "0.3.1"
dev_utils = { path = "dev_utils" }
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
#![feature(avx512_target_feature)]
#![feature(arm_target_feature)]

// It is necessary to import this at the root of the crate
// See: https://github.com/la10736/rstest/tree/master/rstest_reuse#use-rstest_resuse-at-the-top-of-your-crate
#[cfg(test)]
use rstest_reuse;

// #[macro_use]
// extern crate lazy_static;

Expand Down
1 change: 0 additions & 1 deletion src/scalar/scalar_f16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ mod tests {

use half::f16;

extern crate dev_utils;
use dev_utils::utils;

fn get_array_f16(len: usize) -> Vec<f16> {
Expand Down
4 changes: 4 additions & 0 deletions src/simd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ mod simd_u16;
mod simd_u32;
mod simd_u64;
mod simd_u8;

// Test utils
#[cfg(test)]
mod test_utils;
8 changes: 4 additions & 4 deletions src/simd/simd_f16_ignore_nan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use super::generic::{SIMDArgMinMaxIgnoreNaN, SIMDOps, SIMDSetOps};
#[cfg(feature = "half")]
use half::f16;

// ------------------------------------------ AVX2 ------------------------------------------
// --------------------------------------- AVX2 ----------------------------------------

#[cfg(feature = "half")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
Expand All @@ -23,7 +23,7 @@ mod avx2_ignore_nan {
unimpl_SIMDArgMinMaxIgnoreNaN!(f16, usize, AVX2IgnoreNaN);
}

// ----------------------------------------- SSE -----------------------------------------
// ---------------------------------------- SSE ----------------------------------------

#[cfg(feature = "half")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
Expand All @@ -35,7 +35,7 @@ mod sse_ignore_nan {
unimpl_SIMDArgMinMaxIgnoreNaN!(f16, usize, SSEIgnoreNaN);
}

// --------------------------------------- AVX512 ----------------------------------------
// -------------------------------------- AVX512 ---------------------------------------

#[cfg(feature = "half")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
Expand All @@ -47,7 +47,7 @@ mod avx512_ignore_nan {
unimpl_SIMDArgMinMaxIgnoreNaN!(f16, usize, AVX512IgnoreNaN);
}

// ---------------------------------------- NEON -----------------------------------------
// --------------------------------------- NEON ----------------------------------------

#[cfg(feature = "half")]
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
Expand Down
Loading