Commit b3c7cd24 authored by Evgeny Kusmenko's avatar Evgeny Kusmenko
Browse files

Merge branch 'ba_mann' into 'master'

Translates 4 dimensional ports into Armadillo cubes

See merge request !55
parents 4cbff87b b4407dfe
Pipeline #553466 passed with stage
in 7 minutes and 1 second
[Dolphin]
Timestamp=2021,9,23,17,57,26
Version=4
[Settings]
HiddenFilesShown=true
{
"configurations": [
{
"type": "java",
"name": "JAR EMAM2CPP",
"request": "launch",
"mainClass": "de.monticore.lang.monticar.generator.cpp.GeneratorCppCli",
"cwd": "${workspaceFolder}",
"classPaths": [
"${workspaceFolder}/target/embedded-montiarc-math-generator-0.4.5-jar-with-dependencies.jar"
],
"args": [
"--models-dir=temp/model",
"--root-model=de.rwth.armin.modeling.autopilot.autopilot",
"--output-dir=temp/target/cpp",
"--output-name=test1",
"--flag-use-armadillo-backend",
"--tcp-adapter",
"--flag-generate-cmake"
]
}
]
}
\ No newline at end of file
......@@ -10,7 +10,7 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-generator</artifactId>
<version>0.4.8</version>
<version>0.4.9</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
......
......@@ -137,6 +137,10 @@ public class MathConverter {
}
}
public static String get4DCubeTypeInitLine(Variable v, EMAMBluePrintCPP bluePrint) {
return String.format("%s = %s(%s, %s, %s);\n", MathInformationRegister.getVariableInitName(v, bluePrint), curBackend.getCubeTypeName(), v.getDimensionalInformation().get(1), v.getDimensionalInformation().get(2), v.getDimensionalInformation().get(3));
}
public static String getCubeTypeInitLine(Variable v, EMAMBluePrintCPP bluePrint) {
return String.format("%s = %s(%s, %s, %s);\n", MathInformationRegister.getVariableInitName(v, bluePrint), curBackend.getCubeTypeName(), v.getDimensionalInformation().get(0), v.getDimensionalInformation().get(1), v.getDimensionalInformation().get(2));
}
......@@ -171,6 +175,8 @@ public class MathConverter {
initLine = MathConverter.getRowVectorInitLine(v, bluePrint);
} else if (v.getVariableType().getTypeNameTargetLanguage().equals(MathConverter.curBackend.getColumnVectorTypeName())) {
initLine = MathConverter.getColumnVectorInitLine(v, bluePrint);
} else if (v.getVariableType().getTypeNameTargetLanguage().equals(MathConverter.curBackend.getCubeTypeName()) && v.getDimensionalInformation().size() == 4) {
initLine = MathConverter.get4DCubeTypeInitLine(v, bluePrint);
} else if (v.getVariableType().getTypeNameTargetLanguage().equals(MathConverter.curBackend.getCubeTypeName())) {
initLine = MathConverter.getCubeTypeInitLine(v, bluePrint);
} else if (v.getVariableType().getTypeNameTargetLanguage().equals(MathConverter.curBackend.getCubeUnsignedCharName())) {
......
......@@ -144,6 +144,8 @@ public class TypeConverter {
}
} else if (dimensionElements.size() == 3) {
variableType = new VariableType("CommonCubeType", getCubeAccessString(type), MathConverter.curBackend.getIncludeHeaderName());
} else if (dimensionElements.size() == 4) {
variableType = new VariableType("CommonCubeType", getCubeAccessString(type), MathConverter.curBackend.getIncludeHeaderName());
} else {
variableType = new VariableType("CommonMatrixType", getMatAccessString(type), MathConverter.curBackend.getIncludeHeaderName());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment