Skip to content
Snippets Groups Projects
Commit 0f2a2519 authored by James Stevens's avatar James Stevens
Browse files

Merge remote-tracking branch 'upstream/master'

parents c0dcf557 a9951731
No related branches found
No related tags found
1 merge request!18Merge updated statistics functions, tests, documentation, and tutorial sections
import loopy as lp
k = lp.make_kernel([
"[m] -> { [i] : 0 <= i < m }",
"[length] -> { [j] : 0 <= j < length }"],
"""
rowstart = rowstarts[i]
rowend = rowstarts[1 + i]
length = rowend + (-1)*rowstart
rowsum = 0 {id=zerosum}
rowsum = rowsum + x[-1 + colindices[-1 + rowstart + j]]*values[-1 + rowstart + j] {dep=zerosum}
y[i] = rowsum
""")
print(k)
......@@ -914,13 +914,27 @@ def guess_arg_shape_if_requested(kernel, default_order):
if armap.access_range is None:
if armap.bad_subscripts:
raise RuntimeError("cannot determine access range for '%s': "
"undetermined index in subscript(s) '%s'"
% (arg.name, ", ".join(
str(i) for i in armap.bad_subscripts)))
n_axes_in_subscripts = set(
len(sub.index_tuple) for sub in armap.bad_subscripts)
# no subscripts found, let's call it a scalar
shape = ()
if len(n_axes_in_subscripts) != 1:
raise RuntimeError("subscripts of '%s' with differing "
"numbers of axes were found" % arg.name)
n_axes, = n_axes_in_subscripts
if n_axes == 1:
# Leave shape undetermined--we can live with that for 1D.
shape = (None,)
else:
raise RuntimeError("cannot determine access range for '%s': "
"undetermined index in subscript(s) '%s'"
% (arg.name, ", ".join(
str(i) for i in armap.bad_subscripts)))
else:
# no subscripts found, let's call it a scalar
shape = ()
else:
from loopy.isl_helpers import static_max_of_pw_aff
from loopy.symbolic import pw_aff_to_expr
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment