[SYSTEMML-2180] Fix codegen row opening condition for right indexing This patch fixes an issue of invalid generated code for the fuse_all heuristic with disabled rewrites. Specifically, this fixes the OFMC opening condition of row templates to only consider indexing operations with nrow > 1. With rewrites (which is the default) the issue did not show up because the problematic left indexing was eliminated.
Project: http://git-wip-us.apache.org/repos/asf/systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/bc4acdfa Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/bc4acdfa Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/bc4acdfa Branch: refs/heads/master Commit: bc4acdfabdca9ccf89d64078182dd27b63dc1e5e Parents: 41e3325 Author: Matthias Boehm <[email protected]> Authored: Thu Mar 8 19:51:38 2018 -0800 Committer: Matthias Boehm <[email protected]> Committed: Thu Mar 8 19:51:38 2018 -0800 ---------------------------------------------------------------------- .../java/org/apache/sysml/hops/codegen/template/TemplateRow.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/systemml/blob/bc4acdfa/src/main/java/org/apache/sysml/hops/codegen/template/TemplateRow.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/hops/codegen/template/TemplateRow.java b/src/main/java/org/apache/sysml/hops/codegen/template/TemplateRow.java index 6c141ed..1e996d9 100644 --- a/src/main/java/org/apache/sysml/hops/codegen/template/TemplateRow.java +++ b/src/main/java/org/apache/sysml/hops/codegen/template/TemplateRow.java @@ -100,7 +100,8 @@ public class TemplateRow extends TemplateBase || (hop instanceof AggUnaryOp && ((AggUnaryOp)hop).getDirection()!=Direction.RowCol && hop.getInput().get(0).getDim1()>1 && hop.getInput().get(0).getDim2()>1 && HopRewriteUtils.isAggUnaryOp(hop, SUPPORTED_ROW_AGG)) - || (hop instanceof IndexingOp && hop.getInput().get(0).getDim2() >= 0 + || (hop instanceof IndexingOp && hop.getInput().get(0).getDim1() > 1 + && hop.getInput().get(0).getDim2() >= 0 && HopRewriteUtils.isColumnRangeIndexing((IndexingOp)hop)); }
