Skip to content
Snippets Groups Projects
Commit 46f148ea authored by James Willis's avatar James Willis
Browse files

Use intrinsics for vector operations as arithmetic overloading is not...

Use intrinsics for vector operations as arithmetic overloading is not supported by the Intel compiler yet.
parent f5fc9ffc
Branches
Tags
1 merge request!406Doself2 vectorisation
......@@ -247,11 +247,11 @@ __attribute__((always_inline)) INLINE static vector pow_dimension_vec(
#if defined(HYDRO_DIMENSION_3D)
return (vector)(x.v * x.v * x.v);
return (vector)(vec_mul(vec_mul(x.v, x.v), x.v));
#elif defined(HYDRO_DIMENSION_2D)
return (vector)(x.v * x.v);
return (vector)(vec_mul(x.v, x.v));
#elif defined(HYDRO_DIMENSION_1D)
......@@ -276,16 +276,16 @@ __attribute__((always_inline)) INLINE static vector pow_dimension_plus_one_vec(
#if defined(HYDRO_DIMENSION_3D)
const vector x2 = (vector)(x.v * x.v);
return (vector)(x2.v * x2.v);
const vector x2 = (vector)(vec_mul(x.v, x.v));
return (vector)(vec_mul(x2.v, x2.v));
#elif defined(HYDRO_DIMENSION_2D)
return (vector)(x.v * x.v * x.v);
return (vector)(vec_mul(x.v, vec_mul(x.v, x.v)));
#elif defined(HYDRO_DIMENSION_1D)
return (vector)(x.v * x.v);
return (vector)(vec_mul(x.v, x.v));
#else
......
......@@ -68,7 +68,7 @@ int main() {
vx.f[j] = (i + j) * 2.25f / numPoints;
}
vx_h.v = vx.v / vec_set1(h);
vx_h.v = vec_mul(vx.v, vec_set1(1.f/h));
kernel_deval_1_vec(&vx_h, &W_vec, &dW_vec);
......@@ -106,8 +106,8 @@ int main() {
vx_2.f[j] = (i + j) * 2.25f / numPoints;
}
vx_h.v = vx.v / vec_set1(h);
vx_h_2.v = vx_2.v / vec_set1(h);
vx_h.v = vec_mul(vx.v, vec_set1(1.f/h));
vx_h_2.v = vec_mul(vx_2.v, vec_set1(1.f/h));
kernel_deval_2_vec(&vx_h, &W_vec, &dW_vec, &vx_h_2, &W_vec_2, &dW_vec_2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment