Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
6bc3a054
Commit
6bc3a054
authored
Oct 24, 2017
by
Matthieu Schaller
Browse files
Code formatting. Slight changes to documentation of new functions.
parent
ec5ed5de
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/hydro/Gadget2/hydro_iact.h
View file @
6bc3a054
...
...
@@ -607,7 +607,8 @@ runner_iact_nonsym_1_vec_force(
const
vector
balsara_j
=
vector_load
(
Balsara_j
);
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. */
balsara
.
v
=
vec_add
(
balsara_i
.
v
,
balsara_j
.
v
);
...
...
@@ -772,7 +773,8 @@ runner_iact_nonsym_2_vec_force(
const
vector
hj_inv
=
vector_load
(
Hj_inv
);
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. */
balsara
.
v
=
vec_add
(
balsara_i
.
v
,
balsara_j
.
v
);
...
...
src/runner_doiact_vec.c
View file @
6bc3a054
...
...
@@ -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
));
/* 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_mask2
=
vec_is_mask_true
(
v_doi_mask2
)
&
vec_is_mask_true
(
v_doi_mask2_self_check
);
const
int
doi_mask
=
vec_is_mask_true
(
v_doi_mask
)
&
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
* cache. */
...
...
src/vector.h
View file @
6bc3a054
...
...
@@ -20,9 +20,6 @@
#ifndef SWIFT_VECTOR_H
#define SWIFT_VECTOR_H
/* Have I already read this file? */
#ifndef VEC_MACRO
/* Config parameters. */
#include
"../config.h"
...
...
@@ -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.
* @return
temp l
oaded #vector.
* @param x memory
address
to load from.
* @return
L
oaded #vector.
*/
__attribute__
((
always_inline
))
INLINE
vector
vector_load
(
float
*
const
x
)
{
vector
temp
;
temp
.
v
=
vec_load
(
x
);
return
temp
;
}
/**
* @brief
Load
s a vector filled with one value.
* @brief
Return
s a vector filled with one value.
*
* @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
)
{
vector
temp
;
temp
.
v
=
vec_set1
(
x
);
return
temp
;
}
/**
* @brief
Loads a
vector filled with zeros.
* @brief
Returns a new
vector filled with zeros.
*
* @return temp set #vector.
* @return A #vector filled with zeros.
*/
__attribute__
((
always_inline
))
INLINE
vector
vector_setzero
()
{
vector
temp
;
temp
.
v
=
vec_setzero
();
return
temp
;
}
...
...
@@ -480,6 +472,4 @@ __attribute__((always_inline)) INLINE vector vector_setzero() {
#define VEC_SIZE 8
#endif
/* WITH_VECTORIZATION */
#endif
/* VEC_MACRO */
#endif
/* SWIFT_VECTOR_H */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment