You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by mb...@apache.org on 2017/10/10 21:21:16 UTC

systemml git commit: [SYSTEMML-1950] Fix codegen for sparse binary scalar-matrix ops

Repository: systemml
Updated Branches:
  refs/heads/master 31bbeb5b2 -> 4f865b218


[SYSTEMML-1950] Fix codegen for sparse binary scalar-matrix ops

This patch fixes a special case of code generation for sparse
scalar-matrix binary operations such as 0-X, which previously led to
compiler errors.


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

Branch: refs/heads/master
Commit: 4f865b218dd49f5fcbfbc6886c64462e0269bdd2
Parents: 31bbeb5
Author: Matthias Boehm <mb...@gmail.com>
Authored: Tue Oct 10 13:54:10 2017 -0700
Committer: Matthias Boehm <mb...@gmail.com>
Committed: Tue Oct 10 14:21:13 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/sysml/hops/codegen/cplan/CNodeBinary.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/4f865b21/src/main/java/org/apache/sysml/hops/codegen/cplan/CNodeBinary.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/hops/codegen/cplan/CNodeBinary.java b/src/main/java/org/apache/sysml/hops/codegen/cplan/CNodeBinary.java
index 42a36ac..a101647 100644
--- a/src/main/java/org/apache/sysml/hops/codegen/cplan/CNodeBinary.java
+++ b/src/main/java/org/apache/sysml/hops/codegen/cplan/CNodeBinary.java
@@ -269,10 +269,9 @@ public class CNodeBinary extends CNode
 		sb.append(_inputs.get(1).codegen(sparse));
 		
 		//generate binary operation (use sparse template, if data input)
-		boolean lsparse = sparse && (_inputs.get(0) instanceof CNodeData 
-			&& (_inputs.get(0).getVarname().startsWith("a")
-				|| _inputs.get(1).getVarname().startsWith("a"))
-			&& !_inputs.get(0).isLiteral());
+		boolean lsparse = sparse 
+			&& ((_inputs.get(0) instanceof CNodeData && _inputs.get(0).getVarname().startsWith("a"))
+			||(_inputs.get(1) instanceof CNodeData && _inputs.get(1).getVarname().startsWith("a")));
 		boolean scalarInput = _inputs.get(0).getDataType().isScalar();
 		boolean scalarVector = (_inputs.get(0).getDataType().isScalar()
 			&& _inputs.get(1).getDataType().isMatrix());