Skip to content

Commit

Permalink
fix avx512 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersTrier committed Oct 9, 2024
1 parent 5bc1b07 commit 945c03e
Showing 1 changed file with 22 additions and 25 deletions.
47 changes: 22 additions & 25 deletions src/engine/engine_avx512.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,8 @@ mod tests {
#[test]
fn test_avx2() {
let mut rng = rand::thread_rng();

let mut x = vec![0u8; 128];

rng.fill::<[u8]>(x.as_mut());

let mut x = vec![[0u8; 64]; 2];
rng.fill::<[u8]>(x.as_flattened_mut());
let mut x_clone = x.clone();

let avx2 = Avx2::new();
Expand All @@ -482,8 +479,8 @@ mod tests {
#[test]
fn test_mul() {
let mut rng = rand::thread_rng();
let mut x = vec![0u8; 128];
rng.fill::<[u8]>(x.as_mut());
let mut x = vec![[0u8; 64]; 2];
rng.fill::<[u8]>(x.as_flattened_mut());
let mut x_clone = x.clone();

let avx512 = Avx512::new();
Expand All @@ -498,8 +495,8 @@ mod tests {
#[test]
fn test_mul_64() {
let mut rng = rand::thread_rng();
let mut x = vec![0u8; 64];
rng.fill::<[u8]>(x.as_mut());
let mut x = vec![[0u8; 64]; 1];
rng.fill::<[u8]>(x.as_flattened_mut());
let mut x_clone = x.clone();

let avx512 = Avx512::new();
Expand All @@ -514,11 +511,11 @@ mod tests {
#[test]
fn test_ifft_butterfly_partial() {
let mut rng = ChaCha8Rng::from_seed([0; 32]);
let mut x = vec![0u8; 256];
let mut y = vec![0u8; 256];
let mut x = vec![[0u8; 64]; 4];
let mut y = vec![[0u8; 64]; 4];

rng.fill::<[u8]>(x.as_mut());
rng.fill::<[u8]>(y.as_mut());
rng.fill::<[u8]>(x.as_flattened_mut());
rng.fill::<[u8]>(y.as_flattened_mut());

let mut x_clone = x.clone();
let mut y_clone = y.clone();
Expand All @@ -536,11 +533,11 @@ mod tests {
#[test]
fn test_ifft_butterfly_partial_64() {
let mut rng = ChaCha8Rng::from_seed([0; 32]);
let mut x = vec![0u8; 64];
let mut y = vec![0u8; 64];
let mut x = vec![[0u8; 64]; 1];
let mut y = vec![[0u8; 64]; 1];

rng.fill::<[u8]>(x.as_mut());
rng.fill::<[u8]>(y.as_mut());
rng.fill::<[u8]>(x.as_flattened_mut());
rng.fill::<[u8]>(y.as_flattened_mut());

let mut x_clone = x.clone();
let mut y_clone = y.clone();
Expand All @@ -558,11 +555,11 @@ mod tests {
#[test]
fn test_fft_butterfly_partial() {
let mut rng = ChaCha8Rng::from_seed([0; 32]);
let mut x = vec![0u8; 256];
let mut y = vec![0u8; 256];
let mut x = vec![[0u8; 64]; 4];
let mut y = vec![[0u8; 64]; 4];

rng.fill::<[u8]>(x.as_mut());
rng.fill::<[u8]>(y.as_mut());
rng.fill::<[u8]>(x.as_flattened_mut());
rng.fill::<[u8]>(y.as_flattened_mut());

let mut x_clone = x.clone();
let mut y_clone = y.clone();
Expand All @@ -580,11 +577,11 @@ mod tests {
#[test]
fn test_fft_butterfly_partial_64() {
let mut rng = ChaCha8Rng::from_seed([0; 32]);
let mut x = vec![0u8; 64];
let mut y = vec![0u8; 64];
let mut x = vec![[0u8; 64]; 1];
let mut y = vec![[0u8; 64]; 1];

rng.fill::<[u8]>(x.as_mut());
rng.fill::<[u8]>(y.as_mut());
rng.fill::<[u8]>(x.as_flattened_mut());
rng.fill::<[u8]>(y.as_flattened_mut());

let mut x_clone = x.clone();
let mut y_clone = y.clone();
Expand Down

0 comments on commit 945c03e

Please sign in to comment.