From dc65093de08b66cab0f9d9e28fc9dce2f7d53186 Mon Sep 17 00:00:00 2001 From: James Willis <james.s.willis@durham.ac.uk> Date: Thu, 14 Jul 2016 15:52:10 +0100 Subject: [PATCH] Replaced all occurrences of 'VECTORIZE' with 'WITH_VECTORIZATION'. --- src/kernel_gravity.h | 4 +-- src/kernel_hydro.h | 2 +- src/runner_doiact.h | 68 ++++++++++++++++++++-------------------- src/runner_doiact_grav.h | 18 +++++------ 4 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/kernel_gravity.h b/src/kernel_gravity.h index fedc046eed..0c786f5189 100644 --- a/src/kernel_gravity.h +++ b/src/kernel_gravity.h @@ -79,7 +79,7 @@ __attribute__((always_inline)) INLINE static void kernel_grav_eval(float x, *W = w; } -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION /** * @brief Computes the gravity cubic spline for a given distance x (Vectorized @@ -155,7 +155,7 @@ __attribute__((always_inline)) INLINE static void blender_deval(float x, *dW_dx = dw_dx; } -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION /** * @brief Computes the cubic spline blender and its derivative for a given diff --git a/src/kernel_hydro.h b/src/kernel_hydro.h index b1774d8f35..8a1dac79cd 100644 --- a/src/kernel_hydro.h +++ b/src/kernel_hydro.h @@ -225,7 +225,7 @@ __attribute__((always_inline)) INLINE static void kernel_eval( *W = w * kernel_constant * kernel_igamma3; } -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION static const vector kernel_igamma_vec = FILL_VEC((float)kernel_igamma); diff --git a/src/runner_doiact.h b/src/runner_doiact.h index 4da83b940d..193666ad26 100644 --- a/src/runner_doiact.h +++ b/src/runner_doiact.h @@ -113,7 +113,7 @@ void DOPAIR_NAIVE(struct runner *r, struct cell *restrict ci, error("Don't use in actual runs ! Slow code !"); -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION int icount = 0; float r2q[VEC_SIZE] __attribute__((aligned(16))); float hiq[VEC_SIZE] __attribute__((aligned(16))); @@ -169,7 +169,7 @@ void DOPAIR_NAIVE(struct runner *r, struct cell *restrict ci, /* Hit or miss? */ if (r2 < hig2 || r2 < pj->h * pj->h * kernel_gamma2) { -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION IACT(r2, dx, hi, pj->h, pi, pj); @@ -199,7 +199,7 @@ void DOPAIR_NAIVE(struct runner *r, struct cell *restrict ci, } /* loop over the parts in ci. */ -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION /* Pick up any leftovers. */ if (icount > 0) for (int k = 0; k < icount; k++) @@ -215,7 +215,7 @@ void DOSELF_NAIVE(struct runner *r, struct cell *restrict c) { error("Don't use in actual runs ! Slow code !"); -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION int icount = 0; float r2q[VEC_SIZE] __attribute__((aligned(16))); float hiq[VEC_SIZE] __attribute__((aligned(16))); @@ -258,7 +258,7 @@ void DOSELF_NAIVE(struct runner *r, struct cell *restrict c) { /* Hit or miss? */ if (r2 < hig2 || r2 < pj->h * pj->h * kernel_gamma2) { -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION IACT(r2, dx, hi, pj->h, pi, pj); @@ -288,7 +288,7 @@ void DOSELF_NAIVE(struct runner *r, struct cell *restrict c) { } /* loop over the parts in ci. */ -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION /* Pick up any leftovers. */ if (icount > 0) for (int k = 0; k < icount; k++) @@ -317,7 +317,7 @@ void DOPAIR_SUBSET_NAIVE(struct runner *r, struct cell *restrict ci, error("Don't use in actual runs ! Slow code !"); -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION int icount = 0; float r2q[VEC_SIZE] __attribute__((aligned(16))); float hiq[VEC_SIZE] __attribute__((aligned(16))); @@ -367,7 +367,7 @@ void DOPAIR_SUBSET_NAIVE(struct runner *r, struct cell *restrict ci, /* Hit or miss? */ if (r2 < hig2) { -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION IACT_NONSYM(r2, dx, hi, pj->h, pi, pj); @@ -397,7 +397,7 @@ void DOPAIR_SUBSET_NAIVE(struct runner *r, struct cell *restrict ci, } /* loop over the parts in ci. */ -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION /* Pick up any leftovers. */ if (icount > 0) for (int k = 0; k < icount; k++) @@ -424,7 +424,7 @@ void DOPAIR_SUBSET(struct runner *r, struct cell *restrict ci, struct engine *e = r->e; -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION int icount = 0; float r2q[VEC_SIZE] __attribute__((aligned(16))); float hiq[VEC_SIZE] __attribute__((aligned(16))); @@ -499,7 +499,7 @@ void DOPAIR_SUBSET(struct runner *r, struct cell *restrict ci, /* Hit or miss? */ if (r2 < hig2) { -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION IACT_NONSYM(r2, dx, hi, pj->h, pi, pj); @@ -564,7 +564,7 @@ void DOPAIR_SUBSET(struct runner *r, struct cell *restrict ci, /* Hit or miss? */ if (r2 < hig2) { -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION IACT_NONSYM(r2, dx, hi, pj->h, pi, pj); @@ -595,7 +595,7 @@ void DOPAIR_SUBSET(struct runner *r, struct cell *restrict ci, } /* loop over the parts in ci. */ } -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION /* Pick up any leftovers. */ if (icount > 0) for (int k = 0; k < icount; k++) @@ -618,7 +618,7 @@ void DOPAIR_SUBSET(struct runner *r, struct cell *restrict ci, void DOSELF_SUBSET(struct runner *r, struct cell *restrict ci, struct part *restrict parts, int *restrict ind, int count) { -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION int icount = 0; float r2q[VEC_SIZE] __attribute__((aligned(16))); float hiq[VEC_SIZE] __attribute__((aligned(16))); @@ -658,7 +658,7 @@ void DOSELF_SUBSET(struct runner *r, struct cell *restrict ci, /* Hit or miss? */ if (r2 > 0.0f && r2 < hig2) { -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION IACT_NONSYM(r2, dx, hi, pj->h, pi, pj); @@ -688,7 +688,7 @@ void DOSELF_SUBSET(struct runner *r, struct cell *restrict ci, } /* loop over the parts in ci. */ -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION /* Pick up any leftovers. */ if (icount > 0) for (int k = 0; k < icount; k++) @@ -710,7 +710,7 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj) { struct engine *restrict e = r->e; const int ti_current = e->ti_current; -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION int icount = 0; float r2q[VEC_SIZE] __attribute__((aligned(16))); float hiq[VEC_SIZE] __attribute__((aligned(16))); @@ -783,7 +783,7 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj) { /* Hit or miss? */ if (r2 < hig2) { -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION IACT_NONSYM(r2, dx, hi, pj->h, pi, pj); @@ -845,7 +845,7 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj) { /* Hit or miss? */ if (r2 < hjg2) { -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION IACT_NONSYM(r2, dx, hj, pi->h, pj, pi); @@ -875,7 +875,7 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj) { } /* loop over the parts in ci. */ -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION /* Pick up any leftovers. */ if (icount > 0) for (int k = 0; k < icount; k++) @@ -897,7 +897,7 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) { struct engine *restrict e = r->e; const int ti_current = e->ti_current; -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION int icount1 = 0; float r2q1[VEC_SIZE] __attribute__((aligned(16))); float hiq1[VEC_SIZE] __attribute__((aligned(16))); @@ -1009,7 +1009,7 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) { /* Hit or miss? */ if (r2 < hig2) { -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION IACT_NONSYM(r2, dx, hj, hi, pj, pi); @@ -1060,7 +1060,7 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) { /* Hit or miss? */ if (r2 < hig2) { -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION /* Does pj need to be updated too? */ if (pj->ti_end <= ti_current) @@ -1153,7 +1153,7 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) { /* Hit or miss? */ if (r2 < hjg2 && r2 > hi * hi * kernel_gamma2) { -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION IACT_NONSYM(r2, dx, hi, hj, pi, pj); @@ -1203,7 +1203,7 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) { /* Hit or miss? */ if (r2 < hjg2 && r2 > hi * hi * kernel_gamma2) { -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION /* Does pi need to be updated too? */ if (pi->ti_end <= ti_current) @@ -1261,7 +1261,7 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) { } /* loop over the parts in ci. */ -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION /* Pick up any leftovers. */ if (icount1 > 0) for (int k = 0; k < icount1; k++) @@ -1284,7 +1284,7 @@ void DOSELF1(struct runner *r, struct cell *restrict c) { const int ti_current = r->e->ti_current; -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION int icount1 = 0; float r2q1[VEC_SIZE] __attribute__((aligned(16))); float hiq1[VEC_SIZE] __attribute__((aligned(16))); @@ -1350,7 +1350,7 @@ void DOSELF1(struct runner *r, struct cell *restrict c) { /* Hit or miss? */ if (r2 < hj * hj * kernel_gamma2) { -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION IACT_NONSYM(r2, dx, hj, hi, pj, pi); @@ -1406,7 +1406,7 @@ void DOSELF1(struct runner *r, struct cell *restrict c) { /* Hit or miss? */ if (r2 < hig2 || doj) { -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION /* Which parts need to be updated? */ if (r2 < hig2 && doj) @@ -1489,7 +1489,7 @@ void DOSELF1(struct runner *r, struct cell *restrict c) { } /* loop over all particles. */ -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION /* Pick up any leftovers. */ if (icount1 > 0) for (int k = 0; k < icount1; k++) @@ -1512,7 +1512,7 @@ void DOSELF2(struct runner *r, struct cell *restrict c) { const int ti_current = r->e->ti_current; -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION int icount1 = 0; float r2q1[VEC_SIZE] __attribute__((aligned(16))); float hiq1[VEC_SIZE] __attribute__((aligned(16))); @@ -1578,7 +1578,7 @@ void DOSELF2(struct runner *r, struct cell *restrict c) { /* Hit or miss? */ if (r2 < hig2 || r2 < hj * hj * kernel_gamma2) { -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION IACT_NONSYM(r2, dx, hj, hi, pj, pi); @@ -1632,7 +1632,7 @@ void DOSELF2(struct runner *r, struct cell *restrict c) { /* Hit or miss? */ if (r2 < hig2 || r2 < hj * hj * kernel_gamma2) { -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION /* Does pj need to be updated too? */ if (pj->ti_end <= ti_current) @@ -1690,7 +1690,7 @@ void DOSELF2(struct runner *r, struct cell *restrict c) { } /* loop over all particles. */ -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION /* Pick up any leftovers. */ if (icount1 > 0) for (int k = 0; k < icount1; k++) diff --git a/src/runner_doiact_grav.h b/src/runner_doiact_grav.h index e3788dfa11..aaf416e2da 100644 --- a/src/runner_doiact_grav.h +++ b/src/runner_doiact_grav.h @@ -40,7 +40,7 @@ void runner_dopair_grav_new(struct runner *r, struct cell *ci, int count_i, count_j, cnj, cnj_new; const int ti_current = e->ti_current; struct multipole m; -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION int icount = 0; float r2q[VEC_SIZE] __attribute__((aligned(16))); float dxq[3 * VEC_SIZE] __attribute__((aligned(16))); @@ -107,7 +107,7 @@ void runner_dopair_grav_new(struct runner *r, struct cell *ci, r2 += dx[k] * dx[k]; } -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION // if ( pi->part->id == 3473472412525 || pj->part->id == 3473472412525 ) // message( "interacting particles pi=%lli and pj=%lli with r=%.3e in @@ -157,7 +157,7 @@ void runner_dopair_grav_new(struct runner *r, struct cell *ci, } /* loop over the parts in ci. */ -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION /* Pick up any leftovers. */ if (icount > 0) for (k = 0; k < icount; k++) @@ -335,7 +335,7 @@ void runner_dopair_grav(struct runner *r, struct cell *restrict ci, double pix[3]; float dx[3], r2; const int ti_current = r->e->ti_current; -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION int icount = 0; float r2q[VEC_SIZE] __attribute__((aligned(16))); float dxq[3 * VEC_SIZE] __attribute__((aligned(16))); @@ -376,7 +376,7 @@ void runner_dopair_grav(struct runner *r, struct cell *restrict ci, } /* Compute the interaction. */ -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION // if ( pi->part->id == 3473472412525 || pj->part->id == 3473472412525 ) // message( "interacting particles pi=%lli and pj=%lli with r=%.3e in @@ -409,7 +409,7 @@ void runner_dopair_grav(struct runner *r, struct cell *restrict ci, } /* loop over the parts in ci. */ -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION /* Pick up any leftovers. */ if (icount > 0) for (k = 0; k < icount; k++) @@ -434,7 +434,7 @@ void runner_doself_grav(struct runner *r, struct cell *restrict c) { double pix[3] = {0.0, 0.0, 0.0}; float dx[3], r2; const int ti_current = r->e->ti_current; -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION int icount = 0; float r2q[VEC_SIZE] __attribute__((aligned(16))); float dxq[3 * VEC_SIZE] __attribute__((aligned(16))); @@ -466,7 +466,7 @@ void runner_doself_grav(struct runner *r, struct cell *restrict c) { } /* Compute the interaction. */ -#ifndef VECTORIZE +#ifndef WITH_VECTORIZATION // if ( pi->part->id == 3473472412525 || pj->part->id == 3473472412525 ) // message( "interacting particles pi=%lli and pj=%lli with r=%.3e." , @@ -497,7 +497,7 @@ void runner_doself_grav(struct runner *r, struct cell *restrict c) { } /* loop over the parts in c. */ -#ifdef VECTORIZE +#ifdef WITH_VECTORIZATION /* Pick up any leftovers. */ if (icount > 0) for (k = 0; k < icount; k++) -- GitLab