diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2012-04-16 18:16:17 +0100 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2012-04-16 18:16:17 +0100 |
commit | 0d6ec935198f25bcd8fb2687c843efb095563e11 (patch) | |
tree | d190dc5884ae99e86586ee7df8b14af3f619b5a4 /Tools/CodeGen/CodeGenCactus.m | |
parent | 52c4787198ad6e1e905a0911b60e2941f7fd3123 (diff) |
Compactify cakernel.ccl output
This makes it easier to count the number of variables in a kernel
Diffstat (limited to 'Tools/CodeGen/CodeGenCactus.m')
-rw-r--r-- | Tools/CodeGen/CodeGenCactus.m | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Tools/CodeGen/CodeGenCactus.m b/Tools/CodeGen/CodeGenCactus.m index f52d301..7ee10a1 100644 --- a/Tools/CodeGen/CodeGenCactus.m +++ b/Tools/CodeGen/CodeGenCactus.m @@ -75,6 +75,7 @@ PartitionVarList::usage = ""; DataType::usage = "DataType[] returns a string for the grid function data type (e.g. CCTK_REAL)"; SetDataType::usage = "SetDataType[type] sets a string for the grid function data type (e.g. CCTK_REAL)"; CCLBlock; +CCLBlockCompact; CalculationMacros; Begin["`Private`"]; @@ -760,6 +761,15 @@ DefFn[ CBlock[contents], If[comment === "", "", Quote[comment]],"\n"}]; +DefFn[ + CCLBlockCompact[type_String, name_String, attrs:{(_String -> CodeGenBlock)...}, + contents:CodeGenBlock,comment_String:""] := + {type, " ", name, + Map[" "<>#[[1]]<>"="<>#[[2]] &, attrs], + " {", contents, "}", + If[comment === "", "", {" ",Quote[comment]}],"\n"}]; + + CalculationMacros[vectorise_:False] := CommentedBlock["Define macros used in calculations", Map[{"#define ", #, "\n"} &, |