Repository: systemml
Updated Branches:
  refs/heads/master 26fe72f22 -> 8a1f98e1b


[SYSTEMML-2008] Fix codegen row/cell tpl compilation w/ unknown sizes

This patch fixes codegen compilation issues with unknown sizes during
initial compilation. Typically, dynamic recompilation corrects such
invalid generated operators, but for example, in JMLC deployments
dynamic recompilation is disabled by default.


Project: http://git-wip-us.apache.org/repos/asf/systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/8a1f98e1
Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/8a1f98e1
Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/8a1f98e1

Branch: refs/heads/master
Commit: 8a1f98e1be2d7bf8e3400d75bf13ced021c52977
Parents: 26fe72f
Author: Matthias Boehm <[email protected]>
Authored: Tue Nov 7 19:52:00 2017 -0800
Committer: Matthias Boehm <[email protected]>
Committed: Tue Nov 7 19:52:00 2017 -0800

----------------------------------------------------------------------
 .../org/apache/sysml/hops/codegen/template/TemplateCell.java    | 4 ++--
 .../org/apache/sysml/hops/codegen/template/TemplateRow.java     | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/8a1f98e1/src/main/java/org/apache/sysml/hops/codegen/template/TemplateCell.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/hops/codegen/template/TemplateCell.java 
b/src/main/java/org/apache/sysml/hops/codegen/template/TemplateCell.java
index fe5a1e7..50b42ea 100644
--- a/src/main/java/org/apache/sysml/hops/codegen/template/TemplateCell.java
+++ b/src/main/java/org/apache/sysml/hops/codegen/template/TemplateCell.java
@@ -75,8 +75,8 @@ public class TemplateCell extends TemplateBase
        public boolean open(Hop hop) {
                return hop.dimsKnown() && isValidOperation(hop)
                                && !(hop.getDim1()==1 && hop.getDim2()==1)      
-                       || (hop instanceof IndexingOp && (((IndexingOp)hop)
-                               .isColLowerEqualsUpper() || hop.getDim2()==1));
+                       || (hop instanceof IndexingOp && 
hop.getInput().get(0).getDim2() > 0
+                               && (((IndexingOp)hop).isColLowerEqualsUpper() 
|| hop.getDim2()==1));
        }
 
        @Override

http://git-wip-us.apache.org/repos/asf/systemml/blob/8a1f98e1/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 dc08dbf..d91c36e 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
@@ -95,7 +95,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 && 
HopRewriteUtils.isColumnRangeIndexing((IndexingOp)hop));
+                       || (hop instanceof IndexingOp && 
hop.getInput().get(0).getDim2() > 0
+                               && 
HopRewriteUtils.isColumnRangeIndexing((IndexingOp)hop));
        }
 
        @Override
@@ -449,7 +450,7 @@ public class TemplateRow extends TemplateBase
                        out = new CNodeTernary(cdata1, 
                                TemplateUtils.createCNodeData(new 
LiteralOp(hop.getInput().get(0).getDim2()), true),
                                
TemplateUtils.createCNodeData(hop.getInput().get(4), true),
-                               (!hop.dimsKnown()||hop.getDim2()>1) ? 
TernaryType.LOOKUP_RVECT1 : TernaryType.LOOKUP_RC1);
+                               (hop.getDim2() != 1) ? 
TernaryType.LOOKUP_RVECT1 : TernaryType.LOOKUP_RC1);
                }
                
                if( out == null ) {

Reply via email to