Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion doc/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,7 @@ Now to make things more interesting, we'll create a kernel with barriers:
barrier(CLK_LOCAL_MEM_FENCE) /* for c (insn rev-depends on insn_0) */;
c[990 * i + 99 * j + lid(0) + 1] = 2 * a[980 * i + 98 * j + lid(0) + 1];
barrier(CLK_LOCAL_MEM_FENCE) /* for c (insn_0 depends on insn) */;
e[980 * i + 98 * j + lid(0) + 1] = c[990 * i + 99 * j + 1 + lid(0) + 1] + c[990 * i + 99 * j + -1 + lid(0) + 1];
e[980 * i + 98 * j + lid(0) + 1] = c[1 + 990 * i + 99 * j + lid(0) + 1] + c[-1 + 990 * i + 99 * j + lid(0) + 1];
}
}

Expand Down
5 changes: 3 additions & 2 deletions loopy/target/c/codegen/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
LocalHardwareAxisIndex,
ResolvedFunction,
SubArrayRef,
flatten,
)
from loopy.target.c import CExpression
from loopy.type_inference import TypeInferenceMapper, TypeReader
Expand Down Expand Up @@ -336,8 +337,8 @@ def make_var(name):
result = self.make_subscript(
ary,
make_var(access_info.array_name),
simplify_using_aff(
self.kernel, self.rec_arith(subscript, "i")))
flatten(self.rec_arith(
simplify_using_aff(self.kernel, subscript), "i")))

if access_info.vector_index is not None:
return self.codegen_state.ast_builder.add_vector_access(
Expand Down
Loading