Kernel grid size finding ignores kernel assumptions
This can make a difference, as in
>>> p = isl.PwAff('[n] -> { [(floor((8191 + n)/8192))] : 1024*floor((8191 + n)/8192) >= n; [(floor((1023 + n)/1024))] : 1024*floor((8191 + n)/8192) < n }')
>>> from loopy.isl_helpers import static_max_of_pw_aff
>>> static_max_of_pw_aff(p, False)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/wala1/src/loopy/loopy/isl_helpers.py", line 216, in static_max_of_pw_aff
"maximum", context)
File "/home/wala1/src/loopy/loopy/isl_helpers.py", line 206, in static_extremum_of_pw_aff
% (what, pw_aff))
loopy.diagnostic.StaticValueFindingError: a static maximum was not found for PwAff '[n] -> { [(1 + floor((-1 + n)/8192))] : 1024*floor((-1 + n)/8192) >= -1024 + n; [(1 + floor((-1 + n)/1024))] : 1024*floor((-1 + n)/8192) <= -1025 + n }'
versus
>>> static_max_of_pw_aff(p, False, context=isl.Set("[n]->{:n>0}"))
Aff("[n] -> { [(1 + floor((-1 + n)/1024))] }")