mlc-ai / relax

Apache License 2.0
140 stars 70 forks source link

[cherry-pick][METAL] Fix int8 vectorized cast (#14962) #233

Closed Hzfengsy closed 1 year ago

Hzfengsy commented 1 year ago

Current codegen output (half4)*(device uint*)A tries to create a int32 number and then cast it to half4, which is not the expected behavior.

As Metal supports uchar4 and char4 types, we can direct use them to solve that problem.

(cherry picked from commit 6198c7fd8a75534d98efd0ef800b36fc4e3dc021)