diff options
Diffstat (limited to 'Tools/CodeGen')
-rw-r--r-- | Tools/CodeGen/CalculationFunction.m | 2 | ||||
-rw-r--r-- | Tools/CodeGen/CodeGenCactus.m | 3 | ||||
-rw-r--r-- | Tools/CodeGen/Kranc.m | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/Tools/CodeGen/CalculationFunction.m b/Tools/CodeGen/CalculationFunction.m index 572aa6a..39bbe57 100644 --- a/Tools/CodeGen/CalculationFunction.m +++ b/Tools/CodeGen/CalculationFunction.m @@ -269,7 +269,7 @@ simpCollect[collectList_, eqrhs_, localvar_, debug_] := (* Return a CodeGen block which assigns dest by evaluating expr *) assignVariableFromExpression[dest_, expr_, declare_, vectorise_, noSimplify:Boolean : False] := Module[{type, cleanExpr, code}, - type = DataType[]; + type = If[StringMatchQ[ToString[dest], "dir*"], "ptrdiff_t", DataType[]]; cleanExpr = ReplacePowers[expr, vectorise, noSimplify]; If[SOURCELANGUAGE == "C", diff --git a/Tools/CodeGen/CodeGenCactus.m b/Tools/CodeGen/CodeGenCactus.m index 953b394..33b1c6b 100644 --- a/Tools/CodeGen/CodeGenCactus.m +++ b/Tools/CodeGen/CodeGenCactus.m @@ -568,6 +568,7 @@ DefFn[ fabs[x_] -> kfabs[x], fmax[x_,y_] -> kfmax[x,y], fmin[x_,y_] -> kfmin[x,y], + isgn[x_] -> kisgn[x], log[x_] -> klog[x], pow[x_,y_] -> kpow[x,y], sgn[x_] -> ksgn[x], @@ -810,7 +811,7 @@ DefFn[ rhs = rhs //. Max[xx_, yy__] -> fmax[xx, Max[yy]]; rhs = rhs //. Min[xx_, yy__] -> fmin[xx, Min[yy]]; rhs = rhs //. Abs[x_] -> fabs[x]; - rhs = rhs //. Sign[x_] -> sgn[x]; + rhs = rhs //. Sign[x_] -> isgn[x]; rhs = rhs //. IntAbs[x_] -> abs[x]; If[vectorise === True, diff --git a/Tools/CodeGen/Kranc.m b/Tools/CodeGen/Kranc.m index 8d83404..296b2c0 100644 --- a/Tools/CodeGen/Kranc.m +++ b/Tools/CodeGen/Kranc.m @@ -25,10 +25,10 @@ BeginPackage["Kranc`"]; {INV, SQR, CUB, QAD, ScalarINV, ScalarSQR, ScalarCUB, ScalarQAD, IfThen, Parenthesis, Scalar, ToReal, sqrt, exp, log, pow, atan2, cos, sin, tan, acos, asin, atan, - cosh, sinh, tanh, acosh, asinh, atanh, fmax, fmin, fabs, + cosh, sinh, tanh, acosh, asinh, atanh, fmax, fmin, fabs, isgn, sgn, kmadd, kmsub, knmadd, knmsub, kpos, kneg, kadd, ksub, kmul, kdiv, kacos, kacosh, kasin, kasinh, katan, katanh, kcopysign, kcos, kcosh, kfabs, - kfmax, kfmin, ksqrt, kexp, klog, kpow, ksgn, ksin, ksinh, ktan, ktanh, + kfmax, kfmin, kisgn, ksqrt, kexp, klog, kpow, ksgn, ksin, ksinh, ktan, ktanh, dir1, dir2, dir3, dt, dx, dy, dz, khalf, kthird, ktwothird, kfourthird, keightthird}; |