Commit 6bc3a054 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Code formatting. Slight changes to documentation of new functions.

parent ec5ed5de
...@@ -607,7 +607,8 @@ runner_iact_nonsym_1_vec_force( ...@@ -607,7 +607,8 @@ runner_iact_nonsym_1_vec_force(
const vector balsara_j = vector_load(Balsara_j); const vector balsara_j = vector_load(Balsara_j);
const vector cj = vector_load(Cj); const vector cj = vector_load(Cj);
const vector fac_mu = vector_set1(1.f); /* Will change with cosmological integration */ const vector fac_mu =
vector_set1(1.f); /* Will change with cosmological integration */
/* Load stuff. */ /* Load stuff. */
balsara.v = vec_add(balsara_i.v, balsara_j.v); balsara.v = vec_add(balsara_i.v, balsara_j.v);
...@@ -772,7 +773,8 @@ runner_iact_nonsym_2_vec_force( ...@@ -772,7 +773,8 @@ runner_iact_nonsym_2_vec_force(
const vector hj_inv = vector_load(Hj_inv); const vector hj_inv = vector_load(Hj_inv);
const vector hj_inv_2 = vector_load(&Hj_inv[VEC_SIZE]); const vector hj_inv_2 = vector_load(&Hj_inv[VEC_SIZE]);
const vector fac_mu = vector_set1(1.f); /* Will change with cosmological integration */ const vector fac_mu =
vector_set1(1.f); /* Will change with cosmological integration */
/* Find the balsara switch. */ /* Find the balsara switch. */
balsara.v = vec_add(balsara_i.v, balsara_j.v); balsara.v = vec_add(balsara_i.v, balsara_j.v);
......
...@@ -656,8 +656,10 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec( ...@@ -656,8 +656,10 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
vec_create_mask(v_doi_mask2, vec_cmp_lt(v_r2_2.v, v_hig2.v)); vec_create_mask(v_doi_mask2, vec_cmp_lt(v_r2_2.v, v_hig2.v));
/* Combine two masks and form integer masks. */ /* Combine two masks and form integer masks. */
const int doi_mask = vec_is_mask_true(v_doi_mask) & vec_is_mask_true(v_doi_mask_self_check); const int doi_mask = vec_is_mask_true(v_doi_mask) &
const int doi_mask2 = vec_is_mask_true(v_doi_mask2) & vec_is_mask_true(v_doi_mask2_self_check); vec_is_mask_true(v_doi_mask_self_check);
const int doi_mask2 = vec_is_mask_true(v_doi_mask2) &
vec_is_mask_true(v_doi_mask2_self_check);
/* If there are any interactions left pack interaction values into c2 /* If there are any interactions left pack interaction values into c2
* cache. */ * cache. */
......
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
#ifndef SWIFT_VECTOR_H #ifndef SWIFT_VECTOR_H
#define SWIFT_VECTOR_H #define SWIFT_VECTOR_H
/* Have I already read this file? */
#ifndef VEC_MACRO
/* Config parameters. */ /* Config parameters. */
#include "../config.h" #include "../config.h"
...@@ -432,46 +429,41 @@ __attribute__((always_inline)) INLINE vector vec_reciprocal_sqrt(vector x) { ...@@ -432,46 +429,41 @@ __attribute__((always_inline)) INLINE vector vec_reciprocal_sqrt(vector x) {
} }
/** /**
* @brief Loads a vector from memory. * @brief Returns a new vector with data loaded from a memory address.
* *
* @param *x memory to load from. * @param x memory address to load from.
* @return temp loaded #vector. * @return Loaded #vector.
*/ */
__attribute__((always_inline)) INLINE vector vector_load(float *const x) { __attribute__((always_inline)) INLINE vector vector_load(float *const x) {
vector temp; vector temp;
temp.v = vec_load(x); temp.v = vec_load(x);
return temp; return temp;
} }
/** /**
* @brief Loads a vector filled with one value. * @brief Returns a vector filled with one value.
* *
* @param x value to set each element. * @param x value to set each element.
* @return temp set #vector. * @return A #vector filled with a given constant.
*/ */
__attribute__((always_inline)) INLINE vector vector_set1(const float x) { __attribute__((always_inline)) INLINE vector vector_set1(const float x) {
vector temp; vector temp;
temp.v = vec_set1(x); temp.v = vec_set1(x);
return temp; return temp;
} }
/** /**
* @brief Loads a vector filled with zeros. * @brief Returns a new vector filled with zeros.
* *
* @return temp set #vector. * @return temp set #vector.
* @return A #vector filled with zeros.
*/ */
__attribute__((always_inline)) INLINE vector vector_setzero() { __attribute__((always_inline)) INLINE vector vector_setzero() {
vector temp; vector temp;
temp.v = vec_setzero(); temp.v = vec_setzero();
return temp; return temp;
} }
...@@ -480,6 +472,4 @@ __attribute__((always_inline)) INLINE vector vector_setzero() { ...@@ -480,6 +472,4 @@ __attribute__((always_inline)) INLINE vector vector_setzero() {
#define VEC_SIZE 8 #define VEC_SIZE 8
#endif /* WITH_VECTORIZATION */ #endif /* WITH_VECTORIZATION */
#endif /* VEC_MACRO */
#endif /* SWIFT_VECTOR_H */ #endif /* SWIFT_VECTOR_H */
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