Skip to content

API to specify max number of elements #373

Open
@AdamWRichardson

Description

@AdamWRichardson

Thanks all for the great project, I can't wait until this is made stable!

To help with the portability I thought it would be useful to have some way of asking for a SIMD struct with the maximum number of elements supported by the target, such that you could write something like:

let a = f32::with_max_elements();

And that would give you Simd<f32, 16> for a target which supports 512 bits but Simd<f32, 4> on targets which only support 128 bits.

I thought this would be a fairly easy addition so I tried a couple of different implementations (including the one above) but each on so far has had problems. I'm very keen to contribute to the project and would happily write this up but wanted to check a couple of things:

  • Is this something that would be useful and worth implementing?
  • What do you think is the best way to go about this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: a feature request, i.e. not implemented / a PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions