Skip to content
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

[Error] Add error message when the number of elements in kernel arguments exceed #4444

Merged
merged 5 commits into from
Mar 8, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions python/taichi/lang/kernel_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,20 @@ def func__(*args):
if not self.is_grad and self.runtime.target_tape and not self.runtime.grad_replaced:
self.runtime.target_tape.insert(self, args)

if actual_argument_slot > 8 and (
_ti_core.arch_name(impl.current_cfg().arch) == 'opengl'
mzmzm marked this conversation as resolved.
Show resolved Hide resolved
or _ti_core.arch_name(impl.current_cfg().arch) == 'cc'):
raise RuntimeError(
mzmzm marked this conversation as resolved.
Show resolved Hide resolved
f"The number of elements in kernel arguments is too big! Do not exceed 8 on {_ti_core.arch_name(impl.current_cfg().arch)} backend."
)

if actual_argument_slot > 64 and (
(_ti_core.arch_name(impl.current_cfg().arch) != 'opengl'
and _ti_core.arch_name(impl.current_cfg().arch) != 'cc')):
raise RuntimeError(
f"The number of elements in kernel arguments is too big! Do not exceed 64 on {_ti_core.arch_name(impl.current_cfg().arch)} backend."
)

t_kernel(launch_ctx)

ret = None
Expand Down