Commit 6f86ae14 authored by James Willis's avatar James Willis
Browse files

Added #ifdefs to call vectorised version of dopair1_density.

parent 70021c5b
...@@ -47,6 +47,16 @@ ...@@ -47,6 +47,16 @@
#define DOSELF1_NAME "runner_doself1_density" #define DOSELF1_NAME "runner_doself1_density"
#endif #endif
#if defined(WITH_VECTORIZATION) && defined(DOPAIR1_VEC)
#define DOPAIR1 runner_dopair1_density
#define DOPAIR1_NAME "runner_dopair1_density_vec"
#endif
#ifndef DOPAIR1
#define DOPAIR1 runner_dopair1_density
#define DOPAIR1_NAME "runner_dopair1_density"
#endif
enum velocity_types { enum velocity_types {
velocity_zero, velocity_zero,
velocity_random, velocity_random,
...@@ -294,6 +304,7 @@ int check_results(struct part *serial_parts, struct part *vec_parts, int count, ...@@ -294,6 +304,7 @@ int check_results(struct part *serial_parts, struct part *vec_parts, int count,
/* Just a forward declaration... */ /* Just a forward declaration... */
void runner_dopair1_density(struct runner *r, struct cell *ci, struct cell *cj); void runner_dopair1_density(struct runner *r, struct cell *ci, struct cell *cj);
void runner_dopair1_density_vec(struct runner *r, struct cell *ci, struct cell *cj);
void runner_doself1_density(struct runner *r, struct cell *ci); void runner_doself1_density(struct runner *r, struct cell *ci);
void runner_doself1_density_vec(struct runner *r, struct cell *ci); void runner_doself1_density_vec(struct runner *r, struct cell *ci);
void runner_doself1_density_vec_2(struct runner *r, struct cell *ci); void runner_doself1_density_vec_2(struct runner *r, struct cell *ci);
...@@ -375,7 +386,8 @@ int main(int argc, char *argv[]) { ...@@ -375,7 +386,8 @@ int main(int argc, char *argv[]) {
} }
/* Help users... */ /* Help users... */
message("Function called: %s", DOSELF1_NAME); message("DOSELF1 function called: %s", DOSELF1_NAME);
message("DOPAIR1 function called: %s", DOPAIR1_NAME);
message("Vector size: %d", VEC_SIZE); message("Vector size: %d", VEC_SIZE);
message("Adiabatic index: ga = %f", hydro_gamma); message("Adiabatic index: ga = %f", hydro_gamma);
message("Hydro implementation: %s", SPH_IMPLEMENTATION); message("Hydro implementation: %s", SPH_IMPLEMENTATION);
...@@ -436,7 +448,7 @@ int main(int argc, char *argv[]) { ...@@ -436,7 +448,7 @@ int main(int argc, char *argv[]) {
if (cells[j] != main_cell) { if (cells[j] != main_cell) {
const ticks sub_tic = getticks(); const ticks sub_tic = getticks();
runner_dopair1_density(&runner, main_cell, cells[j]); DOPAIR1(&runner, main_cell, cells[j]);
const ticks sub_toc = getticks(); const ticks sub_toc = getticks();
timings[j] += sub_toc - sub_tic; timings[j] += sub_toc - sub_tic;
...@@ -522,8 +534,8 @@ int main(int argc, char *argv[]) { ...@@ -522,8 +534,8 @@ int main(int argc, char *argv[]) {
dump_particle_fields(outputFileName, main_cell, cells); dump_particle_fields(outputFileName, main_cell, cells);
/* Check serial results against the vectorised results. */ /* Check serial results against the vectorised results. */
if (check_results(main_cell->parts, vec_parts, main_cell->count, threshold)) //if (check_results(main_cell->parts, vec_parts, main_cell->count, threshold))
message("Differences found..."); // message("Differences found...");
/* Output timing */ /* Output timing */
message("Brute force calculation took : %15lli ticks.", toc - tic); message("Brute force calculation took : %15lli ticks.", toc - tic);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment