Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
1f0a48a8
Commit
1f0a48a8
authored
7 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Remove duplicates.
parent
3602dceb
No related branches found
No related tags found
1 merge request
!396
Avx512 fixes
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/kernel_hydro.h
+0
-60
0 additions, 60 deletions
src/kernel_hydro.h
src/vector.h
+0
-1
0 additions, 1 deletion
src/vector.h
with
0 additions
and
61 deletions
src/kernel_hydro.h
+
0
−
60
View file @
1f0a48a8
...
...
@@ -707,66 +707,6 @@ __attribute__((always_inline)) INLINE static void kernel_eval_W_vec(vector *u,
vec_mul
(
w
->
v
,
vec_mul
(
kernel_constant_vec
.
v
,
kernel_gamma_inv_dim_vec
.
v
));
}
/**
* @brief Computes the kernel function derivative for two particles
* using vectors. Does not return zero if $u > \\gamma = H/h$, should only
* be called if particles are known to interact.
*
* @param u The ratio of the distance to the smoothing length $u = x/h$.
* @param dw_dx (return) The norm of the gradient of $|\\nabla W(x,h)|$.
*/
__attribute__
((
always_inline
))
INLINE
static
void
kernel_eval_dWdx_vec
(
vector
*
u
,
vector
*
dw_dx
)
{
/* Go to the range [0,1[ from [0,H[ */
vector
x
;
x
.
v
=
vec_mul
(
u
->
v
,
kernel_gamma_inv_vec
.
v
);
#ifdef WENDLAND_C2_KERNEL
/* Init the iteration for Horner's scheme. */
dw_dx
->
v
=
vec_fma
(
wendland_dwdx_const_c0
.
v
,
x
.
v
,
wendland_dwdx_const_c1
.
v
);
/* Calculate the polynomial interleaving vector operations */
dw_dx
->
v
=
vec_fma
(
dw_dx
->
v
,
x
.
v
,
wendland_dwdx_const_c2
.
v
);
dw_dx
->
v
=
vec_fma
(
dw_dx
->
v
,
x
.
v
,
wendland_dwdx_const_c3
.
v
);
dw_dx
->
v
=
vec_mul
(
dw_dx
->
v
,
x
.
v
);
#elif defined(CUBIC_SPLINE_KERNEL)
vector
dw_dx2
;
mask_t
mask_reg1
,
mask_reg2
;
/* Form a mask for each part of the kernel. */
vec_create_mask
(
mask_reg1
,
vec_cmp_lt
(
x
.
v
,
cond
.
v
));
/* 0 < x < 0.5 */
vec_create_mask
(
mask_reg2
,
vec_cmp_gte
(
x
.
v
,
cond
.
v
));
/* 0.5 < x < 1 */
/* Work out w for both regions of the kernel and combine the results together
* using masks. */
/* Init the iteration for Horner's scheme. */
dw_dx
->
v
=
vec_fma
(
cubic_1_dwdx_const_c0
.
v
,
x
.
v
,
cubic_1_dwdx_const_c1
.
v
);
dw_dx2
.
v
=
vec_fma
(
cubic_2_dwdx_const_c0
.
v
,
x
.
v
,
cubic_2_dwdx_const_c1
.
v
);
/* Calculate the polynomial interleaving vector operations. */
dw_dx
->
v
=
vec_mul
(
dw_dx
->
v
,
x
.
v
);
/* cubic_1_dwdx_const_c2 is zero. */
dw_dx2
.
v
=
vec_fma
(
dw_dx2
.
v
,
x
.
v
,
cubic_2_dwdx_const_c2
.
v
);
/* Mask out unneeded values. */
dw_dx
->
v
=
vec_and_mask
(
dw_dx
->
v
,
mask_reg1
);
dw_dx2
.
v
=
vec_and_mask
(
dw_dx2
.
v
,
mask_reg2
);
/* Added both dwdx and dwdx2 together to form complete result. */
dw_dx
->
v
=
vec_add
(
dw_dx
->
v
,
dw_dx2
.
v
);
#else
#error "Vectorisation not supported for this kernel!!!"
#endif
/* Return everything */
dw_dx
->
v
=
vec_mul
(
dw_dx
->
v
,
vec_mul
(
kernel_constant_vec
.
v
,
kernel_gamma_inv_dim_plus_one_vec
.
v
));
}
/**
* @brief Computes the kernel function derivative for two particles
* using vectors.
...
...
This diff is collapsed.
Click to expand it.
src/vector.h
+
0
−
1
View file @
1f0a48a8
...
...
@@ -259,7 +259,6 @@
#define vec_fnma(a, b, c) vec_sub(c, vec_mul(a, b))
#endif
#define vec_fnma(a, b, c) _mm512_fnmadd_ps(a, b, c)
/* Form a packed mask without intrinsics if AVX2 is not present. */
#ifndef VEC_FORM_PACKED_MASK
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment