Skip to content
GitLab
Menu
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
167816b0
Commit
167816b0
authored
Jan 12, 2017
by
James Willis
Browse files
Unrolled kernel loop for wendland C2 variant.
parent
c0de8aba
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/kernel_hydro.h
View file @
167816b0
...
...
@@ -252,6 +252,27 @@ __attribute__((always_inline)) INLINE static void kernel_deval(
/* Go to the range [0,1[ from [0,H[ */
const
float
x
=
u
*
kernel_gamma_inv
;
#ifdef WENDLAND_C2_KERNEL
/* Pick the correct branch of the kernel */
const
float
*
const
coeffs
=
&
kernel_coeffs
[
0
];
/* First two terms of the polynomial ... */
float
w
=
coeffs
[
0
]
*
x
+
coeffs
[
1
];
float
dw_dx
=
coeffs
[
0
];
dw_dx
=
dw_dx
*
x
+
w
;
w
=
x
*
w
+
coeffs
[
2
];
dw_dx
=
dw_dx
*
x
+
w
;
w
=
x
*
w
+
coeffs
[
3
];
dw_dx
=
dw_dx
*
x
+
w
;
w
=
x
*
w
+
coeffs
[
4
];
dw_dx
=
dw_dx
*
x
+
w
;
w
=
x
*
w
+
coeffs
[
5
];
#else
/* Pick the correct branch of the kernel */
const
int
temp
=
(
int
)(
x
*
kernel_ivals_f
);
const
int
ind
=
temp
>
kernel_ivals
?
kernel_ivals
:
temp
;
...
...
@@ -266,6 +287,7 @@ __attribute__((always_inline)) INLINE static void kernel_deval(
dw_dx
=
dw_dx
*
x
+
w
;
w
=
x
*
w
+
coeffs
[
k
];
}
#endif
/* Return everything */
*
W
=
w
*
kernel_constant
*
kernel_gamma_inv_dim
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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