-
Notifications
You must be signed in to change notification settings - Fork 76
add trait ScalarOrVectorComposite
#441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: scalar-or-vector
Are you sure you want to change the base?
Conversation
ce822f1
to
5b6cf85
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, assuming this is zero cost abstraction (like when a struct contains a single scalar field I expect it to compile to the same code as if it was just a single scalar), this makes sense to me.
One opaque thing I do not like as much is that it can implicitly result in multiple subgroup operations. For example like when array is used it'll clearly iterate over each individual value instead of calling a vector form with all or part of the values, which may not be what the user would expect to happen.
2143e1b
to
80dda7d
Compare
5b6cf85
to
5ebd674
Compare
5ebd674
to
6a62178
Compare
Pretty much, otherwise you'd see the subgroup compiletests with disassembly fail due to different codegen.
If you can't observe the difference between a single operation and multiple operations back-to-back, does that actually matter? |
6a62178
to
5a7d997
Compare
Requires #439, #440
rust-gpu/crates/spirv-std/src/scalar_or_vector.rs
Lines 23 to 57 in 6a62178
Also see previous iteration at #411
todo
subgroup_all_equal()
closes #410