summaryrefslogtreecommitdiff
path: root/Debug.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2021-10-09 12:04:14 +0200
committerTom Smeding <tom@tomsmeding.com>2021-10-09 12:04:14 +0200
commitff220bfb4c4c67f666a4701f2514d8de432f1e9a (patch)
tree33d687ec6d94ff1ccae0049ed875ca95039340ed /Debug.hs
parent961b6fc01f9c2f0220070849d22b2a30ca031324 (diff)
Debug printing of expression tree (default off)
Diffstat (limited to 'Debug.hs')
-rw-r--r--Debug.hs69
1 files changed, 69 insertions, 0 deletions
diff --git a/Debug.hs b/Debug.hs
new file mode 100644
index 0000000..bb670d9
--- /dev/null
+++ b/Debug.hs
@@ -0,0 +1,69 @@
+{-# LANGUAGE GADTs #-}
+module Debug where
+
+import Data.Array.Accelerate.AST
+
+
+showPrimFun :: PrimFun a -> String
+showPrimFun PrimAdd{} = "PrimAdd"
+showPrimFun PrimSub{} = "PrimSub"
+showPrimFun PrimMul{} = "PrimMul"
+showPrimFun PrimNeg{} = "PrimNeg"
+showPrimFun PrimAbs{} = "PrimAbs"
+showPrimFun PrimSig{} = "PrimSig"
+showPrimFun PrimQuot{} = "PrimQuot"
+showPrimFun PrimRem{} = "PrimRem"
+showPrimFun PrimQuotRem{} = "PrimQuotRem"
+showPrimFun PrimIDiv{} = "PrimIDiv"
+showPrimFun PrimMod{} = "PrimMod"
+showPrimFun PrimDivMod{} = "PrimDivMod"
+showPrimFun PrimBAnd{} = "PrimBAnd"
+showPrimFun PrimBOr{} = "PrimBOr"
+showPrimFun PrimBXor{} = "PrimBXor"
+showPrimFun PrimBNot{} = "PrimBNot"
+showPrimFun PrimBShiftL{} = "PrimBShiftL"
+showPrimFun PrimBShiftR{} = "PrimBShiftR"
+showPrimFun PrimBRotateL{} = "PrimBRotateL"
+showPrimFun PrimBRotateR{} = "PrimBRotateR"
+showPrimFun PrimPopCount{} = "PrimPopCount"
+showPrimFun PrimCountLeadingZeros{} = "PrimCountLeadingZeros"
+showPrimFun PrimCountTrailingZeros{} = "PrimCountTrailingZeros"
+showPrimFun PrimFDiv{} = "PrimFDiv"
+showPrimFun PrimRecip{} = "PrimRecip"
+showPrimFun PrimSin{} = "PrimSin"
+showPrimFun PrimCos{} = "PrimCos"
+showPrimFun PrimTan{} = "PrimTan"
+showPrimFun PrimAsin{} = "PrimAsin"
+showPrimFun PrimAcos{} = "PrimAcos"
+showPrimFun PrimAtan{} = "PrimAtan"
+showPrimFun PrimSinh{} = "PrimSinh"
+showPrimFun PrimCosh{} = "PrimCosh"
+showPrimFun PrimTanh{} = "PrimTanh"
+showPrimFun PrimAsinh{} = "PrimAsinh"
+showPrimFun PrimAcosh{} = "PrimAcosh"
+showPrimFun PrimAtanh{} = "PrimAtanh"
+showPrimFun PrimExpFloating{} = "PrimExpFloating"
+showPrimFun PrimSqrt{} = "PrimSqrt"
+showPrimFun PrimLog{} = "PrimLog"
+showPrimFun PrimFPow{} = "PrimFPow"
+showPrimFun PrimLogBase{} = "PrimLogBase"
+showPrimFun PrimTruncate{} = "PrimTruncate"
+showPrimFun PrimRound{} = "PrimRound"
+showPrimFun PrimFloor{} = "PrimFloor"
+showPrimFun PrimCeiling{} = "PrimCeiling"
+showPrimFun PrimAtan2{} = "PrimAtan2"
+showPrimFun PrimIsNaN{} = "PrimIsNaN"
+showPrimFun PrimIsInfinite{} = "PrimIsInfinite"
+showPrimFun PrimLt{} = "PrimLt"
+showPrimFun PrimGt{} = "PrimGt"
+showPrimFun PrimLtEq{} = "PrimLtEq"
+showPrimFun PrimGtEq{} = "PrimGtEq"
+showPrimFun PrimEq{} = "PrimEq"
+showPrimFun PrimNEq{} = "PrimNEq"
+showPrimFun PrimMax{} = "PrimMax"
+showPrimFun PrimMin{} = "PrimMin"
+showPrimFun PrimLAnd = "PrimLAnd"
+showPrimFun PrimLOr = "PrimLOr"
+showPrimFun PrimLNot = "PrimLNot"
+showPrimFun PrimFromIntegral{} = "PrimFromIntegral"
+showPrimFun PrimToFloating{} = "PrimToFloating"