File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
crates/cubecl-wgpu/src/compiler/wgsl Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -121,12 +121,16 @@ pub fn call_powf(
121121 rhs : & Variable ,
122122 out : & Variable ,
123123) -> core:: fmt:: Result {
124- let ( rhs, base_name) = if should_use_scalar_powf ( rhs) {
124+ let ( lhs , rhs, base_name) = if should_use_scalar_powf ( rhs) {
125125 let rhs = rhs. fmt_cast_to ( Item :: Scalar ( lhs. elem ( ) ) ) ;
126- ( rhs, POWF_SCALAR )
126+ let lhs = lhs. to_string ( ) ;
127+ ( lhs, rhs, POWF_SCALAR )
127128 } else {
128- let rhs = rhs. fmt_cast_to ( lhs. item ( ) ) ;
129- ( rhs, POWF )
129+ // When vecotized, we make sure the function inputs shared the same vectorization factor as
130+ // the output.
131+ let rhs = rhs. fmt_cast_to ( out. item ( ) ) ;
132+ let lhs = lhs. fmt_cast_to ( out. item ( ) ) ;
133+ ( lhs, rhs, POWF )
130134 } ;
131135 let function_name = construct_vectorized_name ( base_name, out. item ( ) ) ;
132136
You can’t perform that action at this time.
0 commit comments