This commit is contained in:
Matthias
2017-07-24 16:32:17 +02:00
parent 1e535600b1
commit 8d66a6fd57
2 changed files with 8 additions and 10 deletions
@@ -72,7 +72,7 @@ public class SourceFileGenerator {
"}\n"); "}\n");
// main function // main function
if (config.isSkipmain()) { if (!config.isSkipmain()) {
String wfInputCode = repo.getWfInputCode(); String wfInputCode = repo.getWfInputCode();
String wfOutputCode = repo.getWfOutputCode(); String wfOutputCode = repo.getWfOutputCode();
writer.write("\n\nint main(int argc, char** argv) {\n" + writer.write("\n\nint main(int argc, char** argv) {\n" +
@@ -306,14 +306,8 @@ public class SourceFileGenerator {
check2 += StringConstants.parentIsPrevIterFinished + "()"; check2 += StringConstants.parentIsPrevIterFinished + "()";
} }
} }
// write checkReadyForExecution Macro
if (task.getNodeType() != NodeType.ForEachNode if (task.getNodeType() == NodeType.AtomicNode) { // write checkReadyForExecution Macro for atomic nodes
&& task.getNodeType() != NodeType.ParallelForEachNode
&& task.getNodeType() != NodeType.ForNode
&& task.getNodeType() != NodeType.ParallelForNode
&& task.getNodeType() != NodeType.WhileNode
&& task.getNodeType() != NodeType.IfNode
&& task.getNodeType() != NodeType.BlockScopeNode) {
if (!check2.isEmpty() && !checkString.isEmpty()) { if (!check2.isEmpty() && !checkString.isEmpty()) {
writer.write("\t" + StringConstants.selfCheckReadyForExecution2 + "(" + checkString + ", " + check2 + ");\n"); writer.write("\t" + StringConstants.selfCheckReadyForExecution2 + "(" + checkString + ", " + check2 + ");\n");
} else if (!check2.isEmpty() && checkString.isEmpty()) { } else if (!check2.isEmpty() && checkString.isEmpty()) {
@@ -321,6 +315,10 @@ public class SourceFileGenerator {
} else if (!checkString.isEmpty()) { } else if (!checkString.isEmpty()) {
writer.write("\t" + StringConstants.selfCheckReadyForExecution + "(" + checkString + ");\n"); writer.write("\t" + StringConstants.selfCheckReadyForExecution + "(" + checkString + ");\n");
} }
} else { // write areAllInputsAvailable Macro for composite nodes
if (!checkString.isEmpty()) {
writer.write("\t" + StringConstants.selfCheckAllInputsAvailable + "(" + checkString + ");\n");
}
} }
// Epilog // Epilog
writer.write("\t" + StringConstants.inputEpilogMacroName + ";\n"); writer.write("\t" + StringConstants.inputEpilogMacroName + ";\n");
@@ -93,7 +93,7 @@ public class IfGenerator {
writer.write("\t\t" + StringConstants.childOutputBufferGetMacro + "(a" + varIndex writer.write("\t\t" + StringConstants.childOutputBufferGetMacro + "(a" + varIndex
+ StringConstants.outbufferVarPostfix + ", " + pred.getParentNode().getOutPortStruct().getName() + ", a" + varIndex + ", " + StringConstants.outbufferVarPostfix + ", " + pred.getParentNode().getOutPortStruct().getName() + ", a" + varIndex + ", "
+ pred.getParentNode().getId() + ", " + pred.getParentNode().inParentBranch() + ");\n"); + pred.getParentNode().getId() + ", 0);\n");
writer.write("\t\tif (a" + varIndex + StringConstants.outbufferVarPostfix + " != nullptr) {\n"); writer.write("\t\tif (a" + varIndex + StringConstants.outbufferVarPostfix + " != nullptr) {\n");
if (pm.getDataType().equals(pred.getDataType())) { if (pm.getDataType().equals(pred.getDataType())) {