Skip to content
This repository was archived by the owner on Sep 13, 2025. It is now read-only.
This repository was archived by the owner on Sep 13, 2025. It is now read-only.

Unit mismatch in SIMD vector length? #7

Description

@DarthPumpkin

In simd.zig, the vector length is computed as

comptime var vector_len = std.atomic.cache_line / @sizeOf(f32);

It looks to me like there is a unit mismatch here. std.atomic.cache_line is measured in bits, while @sizeOf(f32) is in bytes. Perhaps you are looking for @bitSizeOf(f32)? Or you could use std.simd.suggestVectorLength(), which does something similar.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions