aboutsummaryrefslogtreecommitdiff
path: root/Tools/CodeGen/Thorn.m
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2010-12-06 08:06:35 -0600
committerErik Schnetter <schnetter@cct.lsu.edu>2010-12-06 08:06:35 -0600
commita41bfbe853bf083bdc27f46a88e2a09252d0925d (patch)
tree9b09cfa3578e04ea8a853079c95c9babbdcce257 /Tools/CodeGen/Thorn.m
parentd6c4d4c2131107ef3a4004692823e2041394acd6 (diff)
Rewrite vectorisation infrastructure:
Use "k" prefix more consistently in arithmetic macros. Improve vector code generation patterns. Move all vectorisation run-time out of Kranc and into a new thorn LSUThorns/Vectors, so that non-Kranc thorns can also use it.
Diffstat (limited to 'Tools/CodeGen/Thorn.m')
-rw-r--r--Tools/CodeGen/Thorn.m23
1 files changed, 13 insertions, 10 deletions
diff --git a/Tools/CodeGen/Thorn.m b/Tools/CodeGen/Thorn.m
index 4ada28a..08ba38f 100644
--- a/Tools/CodeGen/Thorn.m
+++ b/Tools/CodeGen/Thorn.m
@@ -220,7 +220,8 @@ Options[CreateConfiguration] = ThornOptions;
CreateConfiguration[opts:OptionsPattern[]] :=
{whoWhen["CCL"],
"REQUIRES GenericFD\n",
- If[OptionValue[UseLoopControl], "REQUIRES LoopControl\n", {}]
+ If[OptionValue[UseLoopControl], "REQUIRES LoopControl\n", {}],
+ If[OptionValue[UseVectors], "REQUIRES Vectors\n", {}]
};
(* ------------------------------------------------------------------------
@@ -475,13 +476,13 @@ CreateSchedule[globalStorageGroups_, scheduledGroups_, scheduledFunctions_] :=
calculationMacros[] :=
CommentedBlock["Define macros used in calculations",
- Map[{"#define ", #, "\n"} &,
- {"INITVALUE (42)",
- "INV(x) (fdiv(ToReal(1.0),x))",
- "SQR(x) (fmul(x,x))",
- "CUB(x) (x*SQR(x))",
- "QAD(x) (SQR(SQR(x)))"
- }]];
+ Map[{"#define ", #, "\n"} &,
+ {"INITVALUE (42)",
+ "INV(x) (kdiv(ToReal(1.0),x))",
+ "SQR(x) (kmul(x,x))",
+ "CUB(x) (x*SQR(x))",
+ "QAD(x) (SQR(SQR(x)))"
+ }]];
(* Given a list of Calculation structures as defined above, create a
CodeGen representation of a source file that defines a function for
@@ -509,8 +510,10 @@ CreateSetterSource[calcs_, debug_, useCSE_, include_, imp_,
],
Map[IncludeFile, Join[{"cctk.h", "cctk_Arguments.h", "cctk_Parameters.h",
- (*"precomputations.h",*) "GenericFD.h", "Vectors.hh", "Differencing.h"}, include,
- If[OptionValue[UseLoopControl], {"loopcontrol.h"}, {}]]],
+ (*"precomputations.h",*) "GenericFD.h", "Differencing.h"},
+ include,
+ If[OptionValue[UseLoopControl], {"loopcontrol.h"}, {}],
+ If[OptionValue[UseVectors], {"vectors.h"}, {}]]],
calculationMacros[],
(* For each function structure passed, create the function and