diff options
author | Barry Wardell <barry.wardell@gmail.com> | 2011-06-18 23:46:31 +0200 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2011-06-19 22:22:28 +0200 |
commit | 5aabf352af333e3ef20c031f42beeafee2c4f07c (patch) | |
tree | 46c9485eaf06940e84bd70d9459c5784022ca4e2 /Tools/CodeGen/CalculationFunction.m | |
parent | dc3d67b7737e12fae5a9102b0980fbdba37878b1 (diff) |
Add Scalar[] which can be used to prevent vectorisation and use it for tests in conditionals. Also add a couple more simplification rules for the vectorisation.
Diffstat (limited to 'Tools/CodeGen/CalculationFunction.m')
-rw-r--r-- | Tools/CodeGen/CalculationFunction.m | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/CodeGen/CalculationFunction.m b/Tools/CodeGen/CalculationFunction.m index d2e626b..e9b6c13 100644 --- a/Tools/CodeGen/CalculationFunction.m +++ b/Tools/CodeGen/CalculationFunction.m @@ -615,13 +615,13 @@ equationLoop[eqs_, cleancalc_, gfs_, shorts_, incs_, groups_, pddefs_, Which[ SameQ[Head[eq2[[2]]], IfThen], ret = assignVariableFromExpression[eq2[[1]], - eq2[[2]] /. IfThen[cond_, x__]:> IfThen[cond, x], declare2, vectorize];, + eq2[[2]] /. IfThen[cond_, x__]:> IfThen[Scalar[cond], x], declare2, vectorize];, SameQ[Head[eq2], IfThenGroup], vars = eq2[[2,All,1]]; cond = eq2[[1]]; preDeclare = Pick[vars, declare2]; ret = {Map[DeclareVariableNoInit[#, DataType[]] &, Complement[Union[preDeclare], localName/@gfsInRHS]], {"\n"}, - Conditional[generateCodeFromExpression[cond, vectorize], + Conditional[generateCodeFromExpression[Scalar[cond], False], Riffle[assignVariableFromExpression[#[[1]], #[[2]], False, vectorize]& /@ eq2[[2]], "\n"], Riffle[assignVariableFromExpression[#[[1]], #[[2]], False, vectorize]& /@ eq2[[3]], "\n"]]};, True, |