From 954a79021eb8e89321f67abcdba8ce209e4faaa0 Mon Sep 17 00:00:00 2001
From: James Willis <james.s.willis@durham.ac.uk>
Date: Tue, 13 Dec 2016 12:11:04 +0000
Subject: [PATCH] Moved entry struct to runner.h for inclusion in
 runner_doiact_vec.h and added #ifdef to call vectorised version of dopair1.

---
 src/runner.c | 19 ++++++-------------
 src/runner.h | 12 ++++++++++++
 2 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/src/runner.c b/src/runner.c
index 35a579bd65..92060301af 100644
--- a/src/runner.c
+++ b/src/runner.c
@@ -61,18 +61,6 @@
 #include "timers.h"
 #include "timestep.h"
 
-/**
- * @brief  Entry in a list of sorted indices.
- */
-struct entry {
-
-  /*! Distance on the axis */
-  float d;
-
-  /*! Particle index */
-  int i;
-};
-
 /* Orientation of the cell pairs */
 const double runner_shift[13][3] = {
     {5.773502691896258e-01, 5.773502691896258e-01, 5.773502691896258e-01},
@@ -1178,8 +1166,13 @@ void *runner_main(void *data) {
           break;
 
         case task_type_pair:
-          if (t->subtype == task_subtype_density)
+          if (t->subtype == task_subtype_density) {
+#ifdef WITH_VECTORIZATION
+            runner_dopair1_density_vec(r, ci, cj);
+#else
             runner_dopair1_density(r, ci, cj);
+#endif
+          }
 #ifdef EXTRA_HYDRO_LOOP
           else if (t->subtype == task_subtype_gradient)
             runner_dopair1_gradient(r, ci, cj);
diff --git a/src/runner.h b/src/runner.h
index b42ad8a5cb..9a0a58fb2a 100644
--- a/src/runner.h
+++ b/src/runner.h
@@ -52,6 +52,18 @@ struct runner {
   struct cache par_cache;
 };
 
+/**
+ * @brief  Entry in a list of sorted indices.
+ */
+struct entry {
+
+  /*! Distance on the axis */
+  float d;
+
+  /*! Particle index */
+  int i;
+};
+
 /* Function prototypes. */
 void runner_do_ghost(struct runner *r, struct cell *c, int timer);
 void runner_do_extra_ghost(struct runner *r, struct cell *c, int timer);
-- 
GitLab