echuraev opened a new pull request, #11021:
URL: https://github.com/apache/tvm/pull/11021
Faced situation when generated OpenCL kernel contained the following if
condition:
```
if (uint4(...) && (int4(...) == int4(...)))
```
In this case, got the following error:
"can't convert between vector values of different size ('uint4' and 'int
__attribute__((ext_vector_type(4)))')"
Added casts for binary ops. But it was necessary to modify `CastFromTo`
and add new method `CastTo`. Because with `CastFromTo` the following
code was generated:
```
if (uint4(...) && (convert_uint4(int4(...)) == convert_uint4(int4(...))))
```
But the OpenCL compiler still generated the same error.
This is why added new method `CastTo`. In this method we don't check the
current type of op and just add cast to a new type.
Finally the following code will be generated:
```
if (uint4(...) && convert_uint4(convert_uint4(int4(...)) ==
convert_uint4(int4(...))))
```
Thanks for contributing to TVM! Please refer to guideline
https://tvm.apache.org/docs/contribute/ for useful information and tips. After
the pull request is submitted, please request code reviews from
[Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers)
by @ them in the pull request thread.
--
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]