yanghaku opened a new pull request, #14850:
URL: https://github.com/apache/tvm/pull/14850

   This PR fixes the wrong data type for the shift expression in WGSL.
   
   In [WGSL standard](https://www.w3.org/TR/WGSL/#bit-expr), The number of bits 
to shift must be u32, but the generated code may has i32 type, such as the 
following:
   ```wgsl
   pad_temp_shared[((i32(threadIdx.z) * 7) + i32(threadIdx.x))] = 
p0[(((((rc_outer * 784) + ((i32(threadIdx.z) >> 2i) * 196)) + (i32(blockIdx.y) 
* 28)) + ((i32(threadIdx.z) & 3) * 7)) + i32(threadIdx.x))];
   ```
   And the error message in tint:
   ```console
   error: no matching overload for operator >> (i32, i32)
   ```
   
   This PR adds a convert, if the number of bits to shift is i32, it will be 
converted to u32. E.g.   `2i` -> `u32(2i)`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to