Skip to content

Commit

Permalink
Handle vectorization of matrix slightly better
Browse files Browse the repository at this point in the history
This partially resolves ticket:2469. Code generation still does not
fully work unless `-v=1` is used.

Belonging to [master]:
  - OpenModelica/OMCompiler#2018
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Nov 15, 2017
1 parent b873818 commit 0a33707
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions Compiler/FrontEnd/Static.mo
Expand Up @@ -10988,6 +10988,7 @@ algorithm
b1 = (ds < Config.vectorizationLimit());
b2 = (ds2 < Config.vectorizationLimit());
true = boolAnd(b1, b2) or Config.vectorizationLimit() == 0;
true = listEmpty(ComponentReference.crefLastSubs(cr));
e = createCrefArray2d(cr, 1, ds, ds2, exptp, t,crefIdType);
then
e;
Expand Down
3 changes: 3 additions & 0 deletions Compiler/SimCode/SimCodeMain.mo
Expand Up @@ -556,6 +556,7 @@ protected
res := (false,{});
try
SimCodeUtil.resetFunctionIndex();
SimCodeFunctionUtil.codegenResetTryThrowIndex();
if Config.acceptMetaModelicaGrammar() or Flags.isSet(Flags.GEN_DEBUG_SYMBOLS) then
Tpl.textFileConvertLines(Tpl.tplCallWithFailErrorNoArg(func), file);
else
Expand All @@ -576,6 +577,7 @@ protected
res := (false,{});
try
SimCodeUtil.resetFunctionIndex();
SimCodeFunctionUtil.codegenResetTryThrowIndex();
Tpl.tplCallWithFailErrorNoArg(func);
res := (true,SimCodeUtil.getFunctionIndex());
else
Expand All @@ -593,6 +595,7 @@ protected
res := (false,{});
try
SimCodeUtil.resetFunctionIndex();
SimCodeFunctionUtil.codegenResetTryThrowIndex();
func();
res := (true,SimCodeUtil.getFunctionIndex());
else
Expand Down

0 comments on commit 0a33707

Please sign in to comment.