- 
                Notifications
    You must be signed in to change notification settings 
- Fork 78
          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: main
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
  
    80dda7d    to
    449c894      
    Compare
  
    5a7d997    to
    ceaceff      
    Compare
  
    449c894    to
    e2d766b      
    Compare
  
    ceaceff    to
    462a4fa      
    Compare
  
    e2d766b    to
    9a6d9ab      
    Compare
  
    462a4fa    to
    bd37adb      
    Compare
  
    bd37adb    to
    1a90208      
    Compare
  
    | Going to let @eddyb review | 
1a90208    to
    2a8211d      
    Compare
  
    2a8211d    to
    0e4b51d      
    Compare
  
    | I'm surprised you say that, since this is only changing some ordinary rust code in  | 
Requires #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()subgroup_broadcast_constadded in subgroup: fix docs and broadcast const variant #443close #410