Skip to content

Commit

Permalink
Add 32-bit index 3 dim benches
Browse files Browse the repository at this point in the history
  • Loading branch information
kauppie committed Mar 13, 2024
1 parent 053b601 commit 4c68184
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions benches/bmi2_zorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ fn bench_bmi2(c: &mut Criterion) {
c.bench_function("bmi2::array_coord_of_u8", |b| {
b.iter(|| unsafe { bmi2::coord_of::<_, 2>(black_box(23776u16)) })
});

c.bench_function("bmi2::array_index_of_u8_dim3", |b| {
b.iter(|| unsafe { bmi2::index_of(black_box([23u8, 18u8, 112u8])) })
});

c.bench_function("bmi2::array_coord_of_u8_dim3", |b| {
b.iter(|| unsafe { bmi2::coord_of::<_, 3>(black_box(2318112u32)) })
});
} else {
panic!("failed to benchmark: bmi2 feature is not detected");
}
Expand Down
8 changes: 8 additions & 0 deletions benches/software_zorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ fn bench_normal(c: &mut Criterion) {
c.bench_function("array_coord_of_u8", |b| {
b.iter(|| coord_of::<_, 2>(black_box(23776u16)))
});

c.bench_function("array_index_of_u8_dim3", |b| {
b.iter(|| index_of(black_box([23u8, 18u8, 112u8])))
});

c.bench_function("array_coord_of_u8_dim3", |b| {
b.iter(|| coord_of::<_, 3>(black_box(2318112u32)))
});
}

criterion_group!(benches, bench_normal,);
Expand Down

0 comments on commit 4c68184

Please sign in to comment.