Skip to content

Commit f1a0d6b

Browse files
feat: Automatically detect the best SIMD size in runtime (#135)
1 parent 509866a commit f1a0d6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/diff.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ pub noinline fn compareSameLayouts(base: *const Image, comp: *const Image, diff_
217217
const base_data = base.data;
218218
const comp_data = comp.data;
219219

220-
const SIMD_SIZE = if (HAS_AVX512) 16 else if (HAS_NEON) 8 else 4;
220+
const SIMD_SIZE = std.simd.suggestVectorLength(u32) orelse if (HAS_AVX512) 16 else if (HAS_NEON) 8 else 4;
221221
const simd_end = (size / SIMD_SIZE) * SIMD_SIZE;
222222

223223
var offset: usize = 0;

0 commit comments

Comments
 (0)