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

disable array bounds check when optimized #239

Closed
wants to merge 4 commits into from
Closed
Changes from all 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
6 changes: 5 additions & 1 deletion arraycontext/loopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
THE SOFTWARE.
"""

import sys

import numpy as np

import loopy as lp
Expand All @@ -41,7 +43,9 @@

_DEFAULT_LOOPY_OPTIONS = lp.Options(
no_numpy=True,
return_dict=True)
return_dict=True,
enforce_array_accesses_within_bounds="no_check" if sys.flags.optimize
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit hesitant about this, because I feel it encourages everyone to run with -O all the time, negating the benefit of possible runtime checks.

I think a possibly better approach might be to just turn off bounds checking for kernels generated by pytato wholesale, as long as no hand-written loopy kernels appear in the DAG.

else True)


def make_loopy_program(domains, statements, kernel_data=None,
Expand Down
Loading