aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorBarry Wardell <barry.wardell@gmail.com>2011-06-18 23:41:48 +0200
committerBarry Wardell <barry.wardell@gmail.com>2011-06-19 22:22:28 +0200
commitdc3d67b7737e12fae5a9102b0980fbdba37878b1 (patch)
tree523519a25b744c3e8c00eee605c5209497bc70fe /Tools
parent8eb49eb4e3b951e2ae15dda13a3e4ed9c5b97d6f (diff)
Add assert() in vectorized code.
Diffstat (limited to 'Tools')
-rw-r--r--Tools/CodeGen/Differencing.m2
-rw-r--r--Tools/CodeGen/KrancThorn.m5
2 files changed, 5 insertions, 2 deletions
diff --git a/Tools/CodeGen/Differencing.m b/Tools/CodeGen/Differencing.m
index 62698b9..8bcecf4 100644
--- a/Tools/CodeGen/Differencing.m
+++ b/Tools/CodeGen/Differencing.m
@@ -355,7 +355,7 @@ ComponentDerivativeOperatorMacroDefinition[componentDerivOp:(name_[inds___] -> e
(* We cannot handle dirN,
so we punt on all expressions that contain dirN *)
If[StringMatchQ[rhs, RegularExpression[".*\\bdir\\d\\b.*"]],
- { "{ return ToReal(1e30); /* ERROR */ }\n" },
+ { "{ assert(0); return ToReal(1e30); /* ERROR */ }\n" },
{ "{\n",
" ptrdiff_t const cdi=sizeof(CCTK_REAL);\n",
" return ", rhs, ";\n",
diff --git a/Tools/CodeGen/KrancThorn.m b/Tools/CodeGen/KrancThorn.m
index a4f96e6..e0acc3d 100644
--- a/Tools/CodeGen/KrancThorn.m
+++ b/Tools/CodeGen/KrancThorn.m
@@ -208,7 +208,10 @@ CreateKrancThorn[groupsOrig_, parentDirectory_, thornName_, opts:OptionsPattern[
InfoMessage[Terse, "Creating differencing header file"];
{pDefs, diffHeader} = CreateDifferencingHeader[partialDerivs, OptionValue[ZeroDimensions], OptionValue[UseVectors]];
diffHeader = Join[
- If[OptionValue[UseVectors], {"#include \"vectors.h\"\n", "\n"}, {}],
+ If[OptionValue[UseVectors], {"#include <assert.h>\n",
+ "#include \"vectors.h\"\n",
+ "\n"},
+ {}],
diffHeader];
(* Add the predefinitions into the calcs *)