36template <
typename simd_type>
46 for (
unsigned int i = 0; i < nq0; ++i)
49 simd_type prod_sum = 0.0;
50 for (
unsigned int k = 0; k < nq0; ++k)
52 simd_type v1 = D0[k * nq0 + i];
53 simd_type v2 = simd_type(in[k]);
62template <
typename simd_type>
64 const unsigned int nq0,
const unsigned int nq1,
const simd_type *in,
65 const simd_type *D0,
const simd_type *D1, simd_type *out_d0,
66 simd_type *out_d1,
bool Deriv0 =
true,
bool Deriv1 =
true)
74 for (
unsigned int i = 0; i < nq0; ++i)
76 for (
unsigned int j = 0; j < nq1; ++j)
79 simd_type prod_sum = 0.0;
80 for (
unsigned int k = 0; k < nq0; ++k)
82 simd_type v1 = D0[k * nq0 + i];
83 simd_type v2 = in[j * nq0 + k];
88 out_d0[j * nq0 + i] = prod_sum;
97 for (
unsigned int i = 0; i < nq0; ++i)
99 for (
unsigned int j = 0; j < nq1; ++j)
102 simd_type prod_sum = 0.0;
103 for (
unsigned int k = 0; k < nq1; ++k)
105 simd_type v1 = in[k * nq0 + i];
106 simd_type v2 = D1[k * nq1 + j];
108 prod_sum.fma(v1, v2);
111 out_d1[j * nq0 + i] = prod_sum;
117template <
typename simd_type>
119 const unsigned int nq0,
const unsigned int nq1,
const simd_type *in0,
120 const simd_type *in1,
const simd_type *D0,
const simd_type *D1,
121 simd_type *out,
const typename simd_type::scalarType scale = 0.0,
122 bool Deriv0 =
true,
bool Deriv1 =
true)
130 for (
unsigned int i = 0; i < nq0; ++i)
132 for (
unsigned int j = 0; j < nq1; ++j)
135 simd_type prod_sum = 0.0;
136 for (
unsigned int k = 0; k < nq0; ++k)
138 simd_type v1 = D0[i * nq0 + k];
139 simd_type v2 = in0[j * nq0 + k];
141 prod_sum.fma(v1, v2);
144 out[j * nq0 + i] *= simd_type(scale);
145 out[j * nq0 + i] += prod_sum;
154 for (
unsigned int j = 0; j < nq1; ++j)
156 for (
unsigned int i = 0; i < nq0; ++i)
159 simd_type prod_sum = 0.0;
160 for (
unsigned int k = 0; k < nq1; ++k)
162 simd_type v1 = in1[k * nq0 + i];
163 simd_type v2 = D1[j * nq1 + k];
165 prod_sum.fma(v1, v2);
168 out[j * nq0 + i] += prod_sum;
174template <
typename simd_type>
176 const unsigned int nq0,
const unsigned int nq1,
const unsigned int nq2,
177 const simd_type *in,
const simd_type *D0,
const simd_type *D1,
178 const simd_type *D2, simd_type *out_d0, simd_type *out_d1,
179 simd_type *out_d2,
bool Deriv0 =
true,
bool Deriv1 =
true,
188 for (
unsigned int i = 0; i < nq0; ++i)
190 for (
unsigned int j = 0; j < nq1 * nq2; ++j)
192 simd_type prod_sum = 0.0;
193 for (
unsigned int k = 0; k < nq0; ++k)
195 simd_type v1 = D0[k * nq0 + i];
196 simd_type v2 = in[j * nq0 + k];
198 prod_sum.fma(v1, v2);
201 out_d0[j * nq0 + i] = prod_sum;
209 for (
unsigned int block = 0; block < nq2; ++block)
211 unsigned int start = block * nq0 * nq1;
213 for (
unsigned int i = 0; i < nq0; ++i)
215 for (
unsigned int j = 0; j < nq1; ++j)
217 simd_type prod_sum = 0.0;
218 for (
unsigned int k = 0; k < nq1; ++k)
220 simd_type v1 = in[start + k * nq0 + i];
221 simd_type v2 = D1[k * nq1 + j];
223 prod_sum.fma(v1, v2);
226 out_d1[start + j * nq0 + i] = prod_sum;
235 for (
unsigned int i = 0; i < nq0 * nq1; ++i)
237 for (
unsigned int j = 0; j < nq2; ++j)
239 simd_type prod_sum = 0.0;
240 for (
unsigned int k = 0; k < nq2; ++k)
242 simd_type v1 = simd_type(in[k * nq0 * nq1 + i]);
243 simd_type v2 = D2[k * nq2 + j];
245 prod_sum.fma(v1, v2);
248 out_d2[j * nq0 * nq1 + i] = prod_sum;
254template <
typename simd_type>
256 const unsigned int nq0,
const unsigned int nq1,
const unsigned int nq2,
257 const simd_type *in0,
const simd_type *in1,
const simd_type *in2,
258 const simd_type *D0,
const simd_type *D1,
const simd_type *D2,
259 simd_type *out,
const typename simd_type::scalarType scale = 0.0,
260 bool Deriv0 =
true,
bool Deriv1 =
true,
bool Deriv2 =
true)
271 for (
unsigned int p = 0; p < nq0; ++p)
273 unsigned int cnt_kji = 0, cnt_kj = 0;
274 for (
unsigned int k = 0; k < nq2; ++k)
276 for (
unsigned int j = 0; j < nq1; ++j, ++cnt_kj)
278 simd_type prod_sum = 0.0;
279 for (
unsigned int i = 0; i < nq0; ++i, ++cnt_kji)
281 simd_type v1 = D0[p * nq0 + i];
282 simd_type v2 = in0[cnt_kji];
284 prod_sum.fma(v1, v2);
286 out[cnt_kj * nq0 + p] *= simd_type(scale);
287 out[cnt_kj * nq0 + p] += prod_sum;
296 for (
unsigned int block = 0; block < nq2; ++block)
298 unsigned int start = block * nq0 * nq1;
300 for (
unsigned int i = 0; i < nq0; ++i)
302 for (
unsigned int j = 0; j < nq1; ++j)
304 simd_type prod_sum = 0.0;
305 for (
unsigned int k = 0; k < nq1; ++k)
307 simd_type v1 = in1[start + k * nq0 + i];
308 simd_type v2 = D1[j * nq1 + k];
310 prod_sum.fma(v1, v2);
313 out[start + j * nq0 + i] += prod_sum;
322 unsigned int cnt_hi = 0;
323 for (
unsigned int h = 0; h < nq1; ++h)
325 for (
unsigned int i = 0; i < nq0; ++i, ++cnt_hi)
327 for (
unsigned int j = 0; j < nq2; ++j)
329 simd_type prod_sum = 0.0;
330 for (
unsigned int k = 0; k < nq2; ++k)
332 simd_type v1 = in2[k * nq0 * nq1 + cnt_hi];
333 simd_type v2 = D2[j * nq2 + k];
335 prod_sum.fma(v1, v2);
338 out[j * nq0 * nq1 + cnt_hi] += prod_sum;
static NEK_FORCE_INLINE void PhysDerivTensor3DKernel(const unsigned int nq0, const unsigned int nq1, const unsigned int nq2, const simd_type *in, const simd_type *D0, const simd_type *D1, const simd_type *D2, simd_type *out_d0, simd_type *out_d1, simd_type *out_d2, bool Deriv0=true, bool Deriv1=true, bool Deriv2=true)
static NEK_FORCE_INLINE void PhysDerivTensor2DKernel(const unsigned int nq0, const unsigned int nq1, const simd_type *in, const simd_type *D0, const simd_type *D1, simd_type *out_d0, simd_type *out_d1, bool Deriv0=true, bool Deriv1=true)
static NEK_FORCE_INLINE void SumDerivTensor2DKernel(const unsigned int nq0, const unsigned int nq1, const simd_type *in0, const simd_type *in1, const simd_type *D0, const simd_type *D1, simd_type *out, const typename simd_type::scalarType scale=0.0, bool Deriv0=true, bool Deriv1=true)
static NEK_FORCE_INLINE void SumDerivTensor3DKernel(const unsigned int nq0, const unsigned int nq1, const unsigned int nq2, const simd_type *in0, const simd_type *in1, const simd_type *in2, const simd_type *D0, const simd_type *D1, const simd_type *D2, simd_type *out, const typename simd_type::scalarType scale=0.0, bool Deriv0=true, bool Deriv1=true, bool Deriv2=true)
static NEK_FORCE_INLINE void PhysDerivTensor1DKernel(const unsigned int nq0, const simd_type *in, const simd_type *D0, simd_type *out_d0)