Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

calebzulawski
Copy link
Member

#322 redux

Arguments for this change:

  • Integer elements impose a very specific view of masks (AVX512, SVE, RVV, etc use bitmasks). Mask<i32, 4> over Simd<f32, 4> only maps to one type of implementation. Mask<f32, 4> just means "a mask over f32s"
  • Some API surface is reduced: T::Mask disappears from everywhere except Mask::to_simd/Mask::from_simd. MaskElement is removed from the public API.

This comment from @thomcc summarizes the arguments against this change in the previous PR: #322 (comment)

  • I think the first comment regarding API friction is no longer relevant, as this PR includes From implementations for all masks. Additionally, Select was changed in Remove poor-performing bitmasks, add Select trait, and enable select on integer bitmasks #482 to allow any mask to select any vector as long as it has the same number of elements. Some code will require slightly more calls into()/cast() in some situations but otherwise there should be minimal overhead.
  • Regarding the second comment about complicated types and projections, this PR doesn't really make this worse anywhere, and probably makes it better in a lot of places, e.g. you can make a function generic over T: SimdElement and that will also be your mask type.

@workingjubilee
Copy link
Member

I have not finished reviewing yet but I have a somewhat complex response that may require a bit to compose. I will nonetheless try to make it timely comparative to my past response rate, apologies for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants