diff --git a/src/runner_doiact_vec.c b/src/runner_doiact_vec.c index 4da0a8d0504b20645cbbcb29e272db4500b7bcf2..03ed0eefb0cce8a4bcb0c796edea303d161e8f9f 100644 --- a/src/runner_doiact_vec.c +++ b/src/runner_doiact_vec.c @@ -54,11 +54,11 @@ * interactions have been performed, should be a multiple of the vector length. */ __attribute__((always_inline)) INLINE static void calcRemInteractions( - struct c2_cache *const int_cache, - const int icount, vector *rhoSum, vector *rho_dhSum, vector *wcountSum, - vector *wcount_dhSum, vector *div_vSum, vector *curlvxSum, - vector *curlvySum, vector *curlvzSum, vector v_hi_inv, vector v_vix, - vector v_viy, vector v_viz, int *icount_align) { + struct c2_cache *const int_cache, const int icount, vector *rhoSum, + vector *rho_dhSum, vector *wcountSum, vector *wcount_dhSum, + vector *div_vSum, vector *curlvxSum, vector *curlvySum, vector *curlvzSum, + vector v_hi_inv, vector v_vix, vector v_viy, vector v_viz, + int *icount_align) { #ifdef HAVE_AVX512_F KNL_MASK_16 knl_mask, knl_mask2; @@ -231,10 +231,9 @@ __attribute__((always_inline)) INLINE static void storeInteractions( int icount_align = *icount; /* Peform remainder interactions. */ - calcRemInteractions(int_cache, *icount, rhoSum, rho_dhSum, - wcountSum, wcount_dhSum, div_vSum, curlvxSum, curlvySum, - curlvzSum, v_hi_inv, v_vix, v_viy, v_viz, - &icount_align); + calcRemInteractions(int_cache, *icount, rhoSum, rho_dhSum, wcountSum, + wcount_dhSum, div_vSum, curlvxSum, curlvySum, curlvzSum, + v_hi_inv, v_vix, v_viy, v_viz, &icount_align); vector int_mask, int_mask2; int_mask.m = vec_setint1(0xFFFFFFFF); @@ -256,7 +255,7 @@ __attribute__((always_inline)) INLINE static void storeInteractions( #endif /* defined(HAVE_AVX2) || defined(HAVE_AVX512_F) */ } -#endif /* WITH_VECTORIZATION */ +#endif /* WITH_VECTORIZATION */ /** * @brief Compute the cell self-interaction (non-symmetric) using vector @@ -453,9 +452,9 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec( } /* Perform padded vector remainder interactions if any are present. */ - calcRemInteractions(&int_cache, icount, &rhoSum, &rho_dhSum, - &wcountSum, &wcount_dhSum, &div_vSum, &curlvxSum, - &curlvySum, &curlvzSum, v_hi_inv, v_vix, v_viy, v_viz, + calcRemInteractions(&int_cache, icount, &rhoSum, &rho_dhSum, &wcountSum, + &wcount_dhSum, &div_vSum, &curlvxSum, &curlvySum, + &curlvzSum, v_hi_inv, v_vix, v_viy, v_viz, &icount_align); /* Initialise masks to true in case remainder interactions have been @@ -779,9 +778,9 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec_2( } /* Perform padded vector remainder interactions if any are present. */ - calcRemInteractions(&int_cache, icount, &rhoSum, &rho_dhSum, - &wcountSum, &wcount_dhSum, &div_vSum, &curlvxSum, - &curlvySum, &curlvzSum, v_hi_inv, v_vix, v_viy, v_viz, + calcRemInteractions(&int_cache, icount, &rhoSum, &rho_dhSum, &wcountSum, + &wcount_dhSum, &div_vSum, &curlvxSum, &curlvySum, + &curlvzSum, v_hi_inv, v_vix, v_viy, v_viz, &icount_align); calcRemInteractions(&int_cache2, icount2, &rhoSum2, &rho_dhSum2, diff --git a/src/vector.h b/src/vector.h index 03fa4875574e28e555f02b32ea00c82f1bf64abd..43f330e391667c1ed3e21aea938a88efc269e295 100644 --- a/src/vector.h +++ b/src/vector.h @@ -257,7 +257,8 @@ typedef union { } vector; /** - * @brief Calculates the inverse ($1/x$) of a vector using intrinsics and a Newton iteration to obtain the correct level of accuracy. + * @brief Calculates the inverse ($1/x$) of a vector using intrinsics and a + * Newton iteration to obtain the correct level of accuracy. * * @param x #vector to be inverted. * @return x_inv #vector inverted x. @@ -267,13 +268,16 @@ __attribute__((always_inline)) INLINE vector vec_reciprocal(vector x) { vector x_inv; x_inv.v = vec_rcp(x.v); - x_inv.v = vec_sub(x_inv.v, vec_mul(x_inv.v, (vec_fma(x.v, x_inv.v, vec_set1(-1.0f))))); + x_inv.v = vec_sub(x_inv.v, + vec_mul(x_inv.v, (vec_fma(x.v, x_inv.v, vec_set1(-1.0f))))); return x_inv; } /** - * @brief Calculates the inverse and square root ($1/\sqrt{x}$) of a vector using intrinsics and a Newton iteration to obtain the correct level of accuracy. + * @brief Calculates the inverse and square root ($1/\sqrt{x}$) of a vector + * using intrinsics and a Newton iteration to obtain the correct level of + * accuracy. * * @param x #vector to be inverted. * @return x_inv #vector inverted x. @@ -283,8 +287,11 @@ __attribute__((always_inline)) INLINE vector vec_reciprocal_sqrt(vector x) { vector x_inv; x_inv.v = vec_rsqrt(x.v); - x_inv.v = vec_sub(x_inv.v, vec_mul(vec_mul(vec_set1(0.5f), x_inv.v), (vec_fma(x.v, vec_mul(x_inv.v, x_inv.v), vec_set1(-1.0f))))); - + x_inv.v = vec_sub( + x_inv.v, + vec_mul(vec_mul(vec_set1(0.5f), x_inv.v), + (vec_fma(x.v, vec_mul(x_inv.v, x_inv.v), vec_set1(-1.0f))))); + return x_inv; } diff --git a/tests/testDump.c b/tests/testDump.c index 5f46d30a4eeb3d936563a3983b89c3d46ecd4a06..ab74a1b1f022761efedf5258a20c525fcef47bd6 100644 --- a/tests/testDump.c +++ b/tests/testDump.c @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) { /* Finalize the dump. */ dump_close(&d); - + /* Return a happy number. */ return 0; }