aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2007-02-14 17:25:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2007-02-14 17:25:00 +0000
commit35d69645010c3e6d13f6ca2a209f8d6d2c58cf30 (patch)
tree9fe8907a829fdbef1c1f5af9237440cea8bd70e5
parent96604179cb8abcd0d1dd4b8569ee748b62622490 (diff)
CarpetLib: Use #include "instantiate" to instantiate the operators
Use #include "instantiate" to instantiate the transport operators. This allows e.g. switching off support for complex numbers. darcs-hash:20070214172513-dae7b-aef2b83617158679c80ac350c2837f519928ddda.gz
-rw-r--r--Carpet/CarpetLib/src/copy_3d.cc39
-rw-r--r--Carpet/CarpetLib/src/interpolate_3d_2tl.cc41
-rw-r--r--Carpet/CarpetLib/src/interpolate_3d_3tl.cc47
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc58
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_o1_rf2.cc29
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_o3_rf2.cc29
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_o5_rf2.cc29
-rw-r--r--Carpet/CarpetLib/src/restrict_3d_cc_rf2.cc29
-rw-r--r--Carpet/CarpetLib/src/restrict_3d_rf2.cc39
9 files changed, 120 insertions, 220 deletions
diff --git a/Carpet/CarpetLib/src/copy_3d.cc b/Carpet/CarpetLib/src/copy_3d.cc
index 45a5c4331..644a67978 100644
--- a/Carpet/CarpetLib/src/copy_3d.cc
+++ b/Carpet/CarpetLib/src/copy_3d.cc
@@ -111,35 +111,18 @@ namespace CarpetLib {
- template
- void
- copy_3d (CCTK_INT const * restrict const src,
- ivect3 const & restrict srcext,
- CCTK_INT * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
-
- template
- void
- copy_3d (CCTK_REAL const * restrict const src,
- ivect3 const & restrict srcext,
- CCTK_REAL * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
-
- template
- void
- copy_3d (CCTK_COMPLEX const * restrict const src,
- ivect3 const & restrict srcext,
- CCTK_COMPLEX * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
+#define INSTANTIATE(T) \
+ template \
+ void \
+ copy_3d (T const * restrict const src, \
+ ivect3 const & restrict srcext, \
+ T * restrict const dst, \
+ ivect3 const & restrict dstext, \
+ ibbox3 const & restrict srcbbox, \
+ ibbox3 const & restrict dstbbox, \
ibbox3 const & restrict regbbox);
+#include "instantiate"
+#undef INSTANTIATE
diff --git a/Carpet/CarpetLib/src/interpolate_3d_2tl.cc b/Carpet/CarpetLib/src/interpolate_3d_2tl.cc
index df696871f..9a2cb99f0 100644
--- a/Carpet/CarpetLib/src/interpolate_3d_2tl.cc
+++ b/Carpet/CarpetLib/src/interpolate_3d_2tl.cc
@@ -136,33 +136,22 @@ namespace CarpetLib {
- template
- void
- interpolate_3d_2tl (CCTK_REAL const * restrict const src1,
- CCTK_REAL const t1,
- CCTK_REAL const * restrict const src2,
- CCTK_REAL const t2,
- ivect3 const & restrict srcext,
- CCTK_REAL * restrict const dst,
- CCTK_REAL const t,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
-
- template
- void
- interpolate_3d_2tl (CCTK_COMPLEX const * restrict const src1,
- CCTK_REAL const t1,
- CCTK_COMPLEX const * restrict const src2,
- CCTK_REAL const t2,
- ivect3 const & restrict srcext,
- CCTK_COMPLEX * restrict const dst,
- CCTK_REAL const t,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
+#define INSTANTIATE(T) \
+ template \
+ void \
+ interpolate_3d_2tl (T const * restrict const src1, \
+ CCTK_REAL const t1, \
+ T const * restrict const src2, \
+ CCTK_REAL const t2, \
+ ivect3 const & restrict srcext, \
+ T * restrict const dst, \
+ CCTK_REAL const t, \
+ ivect3 const & restrict dstext, \
+ ibbox3 const & restrict srcbbox, \
+ ibbox3 const & restrict dstbbox, \
ibbox3 const & restrict regbbox);
+#include "instantiate"
+#undef INSTANTIATE
diff --git a/Carpet/CarpetLib/src/interpolate_3d_3tl.cc b/Carpet/CarpetLib/src/interpolate_3d_3tl.cc
index 3b092a1ac..afcff458b 100644
--- a/Carpet/CarpetLib/src/interpolate_3d_3tl.cc
+++ b/Carpet/CarpetLib/src/interpolate_3d_3tl.cc
@@ -141,37 +141,24 @@ namespace CarpetLib {
- template
- void
- interpolate_3d_3tl (CCTK_REAL const * restrict const src1,
- CCTK_REAL const t1,
- CCTK_REAL const * restrict const src2,
- CCTK_REAL const t2,
- CCTK_REAL const * restrict const src3,
- CCTK_REAL const t3,
- ivect3 const & restrict srcext,
- CCTK_REAL * restrict const dst,
- CCTK_REAL const t,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
-
- template
- void
- interpolate_3d_3tl (CCTK_COMPLEX const * restrict const src1,
- CCTK_REAL const t1,
- CCTK_COMPLEX const * restrict const src2,
- CCTK_REAL const t2,
- CCTK_COMPLEX const * restrict const src3,
- CCTK_REAL const t3,
- ivect3 const & restrict srcext,
- CCTK_COMPLEX * restrict const dst,
- CCTK_REAL const t,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
+#define INSTANTIATE(T) \
+ template \
+ void \
+ interpolate_3d_3tl (T const * restrict const src1, \
+ CCTK_REAL const t1, \
+ T const * restrict const src2, \
+ CCTK_REAL const t2, \
+ T const * restrict const src3, \
+ CCTK_REAL const t3, \
+ ivect3 const & restrict srcext, \
+ T * restrict const dst, \
+ CCTK_REAL const t, \
+ ivect3 const & restrict dstext, \
+ ibbox3 const & restrict srcbbox, \
+ ibbox3 const & restrict dstbbox, \
ibbox3 const & restrict regbbox);
+#include "instantiate"
+#undef INSTANTIATE
diff --git a/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc
index a6cd9207c..751380e53 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc
+++ b/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc
@@ -155,25 +155,18 @@ namespace CarpetLib {
- template
- void
- prolongate_3d_cc_rf2_std2prim (CCTK_REAL const * restrict const src,
- ivect3 const & restrict srcext,
- CCTK_REAL * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
-
- template
- void
- prolongate_3d_cc_rf2_std2prim (CCTK_COMPLEX const * restrict const src,
- ivect3 const & restrict srcext,
- CCTK_COMPLEX * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
+#define INSTANTIATE(T) \
+ template \
+ void \
+ prolongate_3d_cc_rf2_std2prim (T const * restrict const src, \
+ ivect3 const & restrict srcext, \
+ T * restrict const dst, \
+ ivect3 const & restrict dstext, \
+ ibbox3 const & restrict srcbbox, \
+ ibbox3 const & restrict dstbbox, \
ibbox3 const & restrict regbbox);
+#include "instantiate"
+#undef INSTANTIATE
@@ -279,25 +272,18 @@ namespace CarpetLib {
- template
- void
- prolongate_3d_cc_rf2_prim2std (CCTK_REAL const * restrict const src,
- ivect const & restrict srcext,
- CCTK_REAL * restrict const dst,
- ivect const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
-
- template
- void
- prolongate_3d_cc_rf2_prim2std (CCTK_COMPLEX const * restrict const src,
- ivect const & restrict srcext,
- CCTK_COMPLEX * restrict const dst,
- ivect const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
+#define INSTANTIATE(T) \
+ template \
+ void \
+ prolongate_3d_cc_rf2_prim2std (T const * restrict const src, \
+ ivect const & restrict srcext, \
+ T * restrict const dst, \
+ ivect const & restrict dstext, \
+ ibbox3 const & restrict srcbbox, \
+ ibbox3 const & restrict dstbbox, \
ibbox3 const & restrict regbbox);
+#include "instantiate"
+#undef INSTANTIATE
diff --git a/Carpet/CarpetLib/src/prolongate_3d_o1_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_o1_rf2.cc
index 2fb318fad..72c52f05e 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_o1_rf2.cc
+++ b/Carpet/CarpetLib/src/prolongate_3d_o1_rf2.cc
@@ -336,25 +336,18 @@ namespace CarpetLib {
- template
- void
- prolongate_3d_o1_rf2 (CCTK_REAL const * restrict const src,
- ivect3 const & restrict srcext,
- CCTK_REAL * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
-
- template
- void
- prolongate_3d_o1_rf2 (CCTK_COMPLEX const * restrict const src,
- ivect3 const & restrict srcext,
- CCTK_COMPLEX * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
+#define INSTANTIATE(T) \
+ template \
+ void \
+ prolongate_3d_o1_rf2 (T const * restrict const src, \
+ ivect3 const & restrict srcext, \
+ T * restrict const dst, \
+ ivect3 const & restrict dstext, \
+ ibbox3 const & restrict srcbbox, \
+ ibbox3 const & restrict dstbbox, \
ibbox3 const & restrict regbbox);
+#include "instantiate"
+#undef INSTANTIATE
diff --git a/Carpet/CarpetLib/src/prolongate_3d_o3_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_o3_rf2.cc
index 7c3c9ebd4..3e9a606ed 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_o3_rf2.cc
+++ b/Carpet/CarpetLib/src/prolongate_3d_o3_rf2.cc
@@ -440,25 +440,18 @@ namespace CarpetLib {
- template
- void
- prolongate_3d_o3_rf2 (CCTK_REAL const * restrict const src,
- ivect3 const & restrict srcext,
- CCTK_REAL * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
-
- template
- void
- prolongate_3d_o3_rf2 (CCTK_COMPLEX const * restrict const src,
- ivect3 const & restrict srcext,
- CCTK_COMPLEX * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
+#define INSTANTIATE(T) \
+ template \
+ void \
+ prolongate_3d_o3_rf2 (T const * restrict const src, \
+ ivect3 const & restrict srcext, \
+ T * restrict const dst, \
+ ivect3 const & restrict dstext, \
+ ibbox3 const & restrict srcbbox, \
+ ibbox3 const & restrict dstbbox, \
ibbox3 const & restrict regbbox);
+#include "instantiate"
+#undef INSTANTIATE
diff --git a/Carpet/CarpetLib/src/prolongate_3d_o5_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_o5_rf2.cc
index 32788aa25..4d6a1f00b 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_o5_rf2.cc
+++ b/Carpet/CarpetLib/src/prolongate_3d_o5_rf2.cc
@@ -660,25 +660,18 @@ namespace CarpetLib {
- template
- void
- prolongate_3d_o5_rf2 (CCTK_REAL const * restrict const src,
- ivect3 const & restrict srcext,
- CCTK_REAL * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
-
- template
- void
- prolongate_3d_o5_rf2 (CCTK_COMPLEX const * restrict const src,
- ivect3 const & restrict srcext,
- CCTK_COMPLEX * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
+#define INSTANTIATE(T) \
+ template \
+ void \
+ prolongate_3d_o5_rf2 (T const * restrict const src, \
+ ivect3 const & restrict srcext, \
+ T * restrict const dst, \
+ ivect3 const & restrict dstext, \
+ ibbox3 const & restrict srcbbox, \
+ ibbox3 const & restrict dstbbox, \
ibbox3 const & restrict regbbox);
+#include "instantiate"
+#undef INSTANTIATE
diff --git a/Carpet/CarpetLib/src/restrict_3d_cc_rf2.cc b/Carpet/CarpetLib/src/restrict_3d_cc_rf2.cc
index b45ba8f93..5fa543604 100644
--- a/Carpet/CarpetLib/src/restrict_3d_cc_rf2.cc
+++ b/Carpet/CarpetLib/src/restrict_3d_cc_rf2.cc
@@ -136,25 +136,18 @@ namespace CarpetLib {
- template
- void
- restrict_3d_cc_rf2 (CCTK_REAL const * restrict const src,
- ivect3 const & restrict srcext,
- CCTK_REAL * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
-
- template
- void
- restrict_3d_cc_rf2 (CCTK_COMPLEX const * restrict const src,
- ivect3 const & restrict srcext,
- CCTK_COMPLEX * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
+#define INSTANTIATE(T) \
+ template \
+ void \
+ restrict_3d_cc_rf2 (T const * restrict const src, \
+ ivect3 const & restrict srcext, \
+ T * restrict const dst, \
+ ivect3 const & restrict dstext, \
+ ibbox3 const & restrict srcbbox, \
+ ibbox3 const & restrict dstbbox, \
ibbox3 const & restrict regbbox);
+#include "instantiate"
+#undef INSTANTIATE
diff --git a/Carpet/CarpetLib/src/restrict_3d_rf2.cc b/Carpet/CarpetLib/src/restrict_3d_rf2.cc
index c78f7a682..fc8490dae 100644
--- a/Carpet/CarpetLib/src/restrict_3d_rf2.cc
+++ b/Carpet/CarpetLib/src/restrict_3d_rf2.cc
@@ -111,35 +111,18 @@ namespace CarpetLib {
- template
- void
- restrict_3d_rf2 (CCTK_INT const * restrict const src,
- ivect3 const & restrict srcext,
- CCTK_INT * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
-
- template
- void
- restrict_3d_rf2 (CCTK_REAL const * restrict const src,
- ivect3 const & restrict srcext,
- CCTK_REAL * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
-
- template
- void
- restrict_3d_rf2 (CCTK_COMPLEX const * restrict const src,
- ivect3 const & restrict srcext,
- CCTK_COMPLEX * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
+#define INSTANTIATE(T) \
+ template \
+ void \
+ restrict_3d_rf2 (T const * restrict const src, \
+ ivect3 const & restrict srcext, \
+ T * restrict const dst, \
+ ivect3 const & restrict dstext, \
+ ibbox3 const & restrict srcbbox, \
+ ibbox3 const & restrict dstbbox, \
ibbox3 const & restrict regbbox);
+#include "instantiate"
+#undef INSTANTIATE