aboutsummaryrefslogtreecommitdiff
path: root/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2009-04-27 11:29:45 -0500
committerIan Hinder <ian.hinder@aei.mpg.de>2009-04-27 21:52:21 +0200
commit5a954d37db3b107945cb8e386ef97b61926009a7 (patch)
treee1832eadb54240e27a2815c091ab68d57ed3f1bb /Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h
parent269ff945b9bbed7724db0d960c671a6e5f15b801 (diff)
Add (currently unused) macros and definitions for dealing with vectors of grid points. This may allow generating vectorised code in the future.
Diffstat (limited to 'Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h')
-rw-r--r--Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h
index 6dd1067..a34f6d0 100644
--- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h
+++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h
@@ -765,4 +765,40 @@ void GenericFD_LoopOverBoundary(cGH *cctkGH, Kranc_Calculation calc);
void GenericFD_LoopOverBoundaryWithGhosts(cGH *cctkGH, Kranc_Calculation calc);
void GenericFD_LoopOverInterior(cGH *cctkGH, Kranc_Calculation calc);
+
+
+/* Vectorisation of memory accesses */
+
+#include <stdlib.h>
+#include <cctk.h>
+
+#if defined(__SSE2__) && defined(CCTK_REAL_PRECISION_8)
+
+#include <emmintrin.h>
+
+/* A vector type corresponding to CCTK_REAL */
+typedef __m128d CCTK_REAL_VEC;
+
+/* Really only SSE is required, but there doesn't seem to be a
+ preprocessing flag to check for this */
+#elif defined(__SSE2__) && defined(CCTK_REAL_PRECISION_4)
+
+#include <emmintrin.h>
+
+/* A vector type corresponding to CCTK_REAL */
+typedef __m128 CCTK_REAL_VEC;
+
+#else
+
+/* There is no vector type corresponding to CCTK_REAL */
+typedef CCTK_REAL CCTK_REAL_VEC;
+
+#endif
+
+/* The number of vector elements in a CCTK_REAL_VEC */
+static
+size_t const CCTK_REAL_VEC_SIZE = sizeof(CCTK_REAL_VEC) / sizeof(CCTK_REAL);
+
+
+
#endif