35 #ifndef __COMMON_MAKEEXT_KERNEL__
36 #define __COMMON_MAKEEXT_KERNEL__
38 template<
typename T >
40 T * __restrict__ aby1,
41 T * __restrict__ abz1,
42 T * __restrict__ abx2,
43 T * __restrict__ aby2,
44 T * __restrict__ abz2,
54 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
55 const int str = blockDim.x * gridDim.x;
57 for (
int i = idx;
i < n;
i += str) {
58 T ta1_val = ab2 * abx1[
i] + ab3 * abx2[
i];
59 T ta2_val = ab2 * aby1[
i] + ab3 * aby2[
i];
60 T ta3_val = ab2 * abz1[
i] + ab3 * abz2[
i];
69 bfx[
i] = (ab1 * bfx[
i] + ta1_val) * rho;
70 bfy[
i] = (ab1 * bfy[
i] + ta2_val) * rho;
71 bfz[
i] = (ab1 * bfz[
i] + ta3_val) * rho;
76 template<
typename T >
78 T * __restrict__ fs_laglag,
86 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
87 const int str = blockDim.x * gridDim.x;
89 for (
int i = idx;
i < n;
i += str) {
90 T ta1_val = ext2 * fs_lag[
i] + ext3 * fs_laglag[
i];
92 fs_laglag[
i] = fs_lag[
i];
95 fs[
i] = (ext1 * fs[
i] + ta1_val) * rho;
__global__ void makeext_kernel(T *__restrict__ abx1, T *__restrict__ aby1, T *__restrict__ abz1, T *__restrict__ abx2, T *__restrict__ aby2, T *__restrict__ abz2, T *__restrict__ bfx, T *__restrict__ bfy, T *__restrict__ bfz, const T rho, const T ab1, const T ab2, const T ab3, const int n)
__global__ void scalar_makeext_kernel(T *__restrict__ fs_lag, T *__restrict__ fs_laglag, T *__restrict__ fs, const T rho, const T ext1, const T ext2, const T ext3, const int n)