-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ir] ti.func parameter types are not casted #7946
Comments
lin-hitonami
added a commit
that referenced
this issue
Jun 16, 2023
…type hints exist (#8193) Issue: fix #7946 ### Brief Summary <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at 6275116</samp> This pull request implements automatic scalar casting for function arguments and return values based on type annotations in Taichi. It also adds two test cases in `test_argument.py` and `test_return.py` to verify the feature. ### Walkthrough <!-- copilot:walkthrough --> ### <samp>🤖 Generated by Copilot at 6275116</samp> * Add automatic scalar casting for function arguments and return values ([link](https://github.com/taichi-dev/taichi/pull/8193/files?diff=unified&w=0#diff-3e22417ffade4af0564893b98dc5101d714b8ba6fd4423ab5bc5129e360fee8fR740-R744), [link](https://github.com/taichi-dev/taichi/pull/8193/files?diff=unified&w=0#diff-3e22417ffade4af0564893b98dc5101d714b8ba6fd4423ab5bc5129e360fee8fR863-R864)) * Add test cases for scalar argument and return value casting ([link](https://github.com/taichi-dev/taichi/pull/8193/files?diff=unified&w=0#diff-f2d9c4a8c504d2073549cde99b31a733a2f39bba4ce9f062cbaa09e1be17aa87R264-R276), [link](https://github.com/taichi-dev/taichi/pull/8193/files?diff=unified&w=0#diff-e206c19691b4678b401a5e2787000e93ab0b0060cbf4ac2625b51f87599d98d8R251-R263))
L2ncE
pushed a commit
to L2ncE/taichi
that referenced
this issue
Jun 20, 2023
…type hints exist (taichi-dev#8193) Issue: fix taichi-dev#7946 ### Brief Summary <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at 6275116</samp> This pull request implements automatic scalar casting for function arguments and return values based on type annotations in Taichi. It also adds two test cases in `test_argument.py` and `test_return.py` to verify the feature. ### Walkthrough <!-- copilot:walkthrough --> ### <samp>🤖 Generated by Copilot at 6275116</samp> * Add automatic scalar casting for function arguments and return values ([link](https://github.com/taichi-dev/taichi/pull/8193/files?diff=unified&w=0#diff-3e22417ffade4af0564893b98dc5101d714b8ba6fd4423ab5bc5129e360fee8fR740-R744), [link](https://github.com/taichi-dev/taichi/pull/8193/files?diff=unified&w=0#diff-3e22417ffade4af0564893b98dc5101d714b8ba6fd4423ab5bc5129e360fee8fR863-R864)) * Add test cases for scalar argument and return value casting ([link](https://github.com/taichi-dev/taichi/pull/8193/files?diff=unified&w=0#diff-f2d9c4a8c504d2073549cde99b31a733a2f39bba4ce9f062cbaa09e1be17aa87R264-R276), [link](https://github.com/taichi-dev/taichi/pull/8193/files?diff=unified&w=0#diff-e206c19691b4678b401a5e2787000e93ab0b0060cbf4ac2625b51f87599d98d8R251-R263))
PGZXB
pushed a commit
to PGZXB/taichi
that referenced
this issue
Jul 13, 2023
…type hints exist (taichi-dev#8193) Issue: fix taichi-dev#7946 ### Brief Summary <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at 6275116</samp> This pull request implements automatic scalar casting for function arguments and return values based on type annotations in Taichi. It also adds two test cases in `test_argument.py` and `test_return.py` to verify the feature. ### Walkthrough <!-- copilot:walkthrough --> ### <samp>🤖 Generated by Copilot at 6275116</samp> * Add automatic scalar casting for function arguments and return values ([link](https://github.com/taichi-dev/taichi/pull/8193/files?diff=unified&w=0#diff-3e22417ffade4af0564893b98dc5101d714b8ba6fd4423ab5bc5129e360fee8fR740-R744), [link](https://github.com/taichi-dev/taichi/pull/8193/files?diff=unified&w=0#diff-3e22417ffade4af0564893b98dc5101d714b8ba6fd4423ab5bc5129e360fee8fR863-R864)) * Add test cases for scalar argument and return value casting ([link](https://github.com/taichi-dev/taichi/pull/8193/files?diff=unified&w=0#diff-f2d9c4a8c504d2073549cde99b31a733a2f39bba4ce9f062cbaa09e1be17aa87R264-R276), [link](https://github.com/taichi-dev/taichi/pull/8193/files?diff=unified&w=0#diff-e206c19691b4678b401a5e2787000e93ab0b0060cbf4ac2625b51f87599d98d8R251-R263))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Repro:
This emits warning:
I'd expect if I declare function parameter as
ti.i32
, when I'm calling the function argument should be passed by value and casted to i32, it seems it stayed as i16.The text was updated successfully, but these errors were encountered: