You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/04/15 09:45:31 UTC

[GitHub] [tvm] echuraev opened a new pull request, #11021: [OpenCL] Fix type casting error

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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] echuraev closed pull request #11021: [OpenCL] Fix type casting error

Posted by GitBox <gi...@apache.org>.
echuraev closed pull request #11021: [OpenCL] Fix type casting error
URL: https://github.com/apache/tvm/pull/11021


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] echuraev commented on pull request #11021: [OpenCL] Fix type casting error

Posted by GitBox <gi...@apache.org>.
echuraev commented on PR #11021:
URL: https://github.com/apache/tvm/pull/11021#issuecomment-1100108829

   Sorry, closed and opened this PR several times, due to on our branch I saw some problems with generated kernels. But all these problems were specific for our branch, because we have modified the codegen. This PR should work on the tvm/main.
   
   @csullivan, @masahi, @comaniac please, review it.


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] echuraev closed pull request #11021: [OpenCL] Fix type casting error

Posted by GitBox <gi...@apache.org>.
echuraev closed pull request #11021: [OpenCL] Fix type casting error
URL: https://github.com/apache/tvm/pull/11021


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] masahi merged pull request #11021: [OpenCL] Fix type casting error

Posted by GitBox <gi...@apache.org>.
masahi merged PR #11021:
URL: https://github.com/apache/tvm/pull/11021


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org