80#define CASE_1D(LX, C) \
81 ax_helm_kernel_1d<real, LX, NEKO_CHUNKS(LX, C)> \
82 <<<nblcks_1d, NEKO_CHUNKS_NTHRDS(LX, C), 0, stream>>> \
83 ((real *) w, (real *) u, \
84 (real *) dx, (real *) dy, (real *) dz, \
85 (real *) dxt, (real *) dyt, (real *) dzt, (real *) h1,\
86 (real *) g11, (real *) g22, (real *) g33, \
87 (real *) g12, (real *) g13, (real *) g23); \
88 CUDA_CHECK(cudaGetLastError());
91#define CASE_1D_SEL(LX, SEL) \
93 case 0: CASE_1D(LX, 0); break; \
94 case 1: CASE_1D(LX, 1); break; \
95 case 2: CASE_1D(LX, 2); break; \
96 default: CASE_1D(LX, 3); break; \
99#define CASE_KSTEP(LX, C) \
100 ax_helm_kernel_kstep<real, LX, NEKO_EB(LX, C)> \
101 <<<NEKO_EB_NBLCKS(*nelv, LX, C), NEKO_EB_NTHRDS(LX, C), 0, stream>>> \
102 ((real *) w, (real *) u, \
103 (real *) dx, (real *) dy, (real *) dz, (real *) h1, \
104 (real *) g11, (real *) g22, (real *) g33, \
105 (real *) g12, (real *) g13, (real *) g23, *nelv); \
106 CUDA_CHECK(cudaGetLastError());
108#define CASE_KSTEP_PADDED(LX, C) \
109 ax_helm_kernel_kstep_padded<real, LX, NEKO_EB(LX, C)> \
110 <<<NEKO_EB_NBLCKS(*nelv, LX, C), NEKO_EB_NTHRDS(LX, C), 0, stream>>> \
111 ((real *) w, (real *) u, \
112 (real *) dx, (real *) dy, (real *) dz, (real *) h1, \
113 (real *) g11, (real *) g22, (real *) g33, \
114 (real *) g12, (real *) g13, (real *) g23, *nelv); \
115 CUDA_CHECK(cudaGetLastError());
118#define CASE_KSTEP_SEL(LX, SEL) \
120 case 0: CASE_KSTEP(LX, 0); break; \
121 case 1: CASE_KSTEP(LX, 1); break; \
122 default: CASE_KSTEP(LX, 2); break; \
125#define CASE_KSTEP_PADDED_SEL(LX, SEL) \
127 case 0: CASE_KSTEP_PADDED(LX, 0); break; \
128 case 1: CASE_KSTEP_PADDED(LX, 1); break; \
129 default: CASE_KSTEP_PADDED(LX, 2); break; \
134 if(autotune[LX] == 0 ) { \
135 autotune[LX]=tune<LX>( w, u, \
139 g12, g13, g23, nelv, lx, \
140 &autotune_eb[LX], &autotune_ch[LX]); \
141 } else if (autotune[LX] == 1 ) { \
142 CASE_1D_SEL(LX, autotune_ch[LX]); \
143 } else if (autotune[LX] == 2 ) { \
144 CASE_KSTEP_SEL(LX, autotune_eb[LX]); \
148#define CASE_PADDED(LX) \
150 if(autotune[LX] == 0 ) { \
151 autotune[LX]=tune_padded<LX>(w, u, \
155 g12, g13, g23,nelv,lx, \
156 &autotune_eb[LX], &autotune_ch[LX]); \
157 } else if (autotune[LX] == 1 ) { \
158 CASE_1D_SEL(LX, autotune_ch[LX]); \
159 } else if (autotune[LX] == 2 ) { \
160 CASE_KSTEP_PADDED_SEL(LX, autotune_eb[LX]); \
169#define CASE_LARGE(LX) \
174#define CASE_LARGE_PADDED(LX) \
176 CASE_KSTEP_PADDED(LX, 0); \
218 void *
u,
void *
v,
void *
w,
219 void *
dx,
void *
dy,
void *
dz,
223 void *
g23,
int *
nelv,
int *lx) {
231#define AX_VEC_EB(LX) (elem_block<LX, NEKO_AX_HELM_VECTOR_EB_C>::value)
232#define AX_VEC_NTHRDS(LX) dim3((LX), (LX), AX_VEC_EB(LX))
233#define AX_VEC_NBLCKS(LX) \
234 dim3(((*nelv) + AX_VEC_EB(LX) - 1)/AX_VEC_EB(LX), 1, 1)
236#define CASE_VECTOR_KSTEP(LX) \
237 ax_helm_kernel_vector_kstep<real, LX, AX_VEC_EB(LX)> \
238 <<<AX_VEC_NBLCKS(LX), AX_VEC_NTHRDS(LX), 0, stream>>> \
239 ((real *) au, (real *) av, (real *) aw, \
240 (real *) u, (real *) v, (real *) w, \
241 (real *) dx, (real *) dy, (real *) dz, \
242 (real *) h1, (real *) g11, (real *) g22, \
243 (real *) g33, (real *) g12, (real *) g13, \
244 (real *) g23, *nelv); \
245 CUDA_CHECK(cudaGetLastError());
247#define CASE_VECTOR_KSTEP_PADDED(LX) \
248 ax_helm_kernel_vector_kstep_padded<real, LX, AX_VEC_EB(LX)> \
249 <<<AX_VEC_NBLCKS(LX), AX_VEC_NTHRDS(LX), 0, stream>>> \
250 ((real *) au, (real *) av, (real *) aw, \
251 (real *) u, (real *) v, (real *) w, \
252 (real *) dx, (real *) dy, (real *) dz, \
253 (real *) h1, (real *) g11, (real *) g22, \
254 (real *) g33, (real *) g12, (real *) g13, \
255 (real *) g23, *nelv); \
256 CUDA_CHECK(cudaGetLastError());
258#define CASE_VECTOR(LX) \
260 CASE_VECTOR_KSTEP(LX); \
263#define CASE_VECTOR_PADDED(LX) \
265 CASE_VECTOR_KSTEP_PADDED(LX); \
296 void *
u,
void *
v,
void *
w,
297 void *h2,
void *B,
int *n) {
300 const dim3 nblcks(((*n)+1024 - 1)/ 1024, 1, 1);
310template < const
int LX >
391 for (
int r = 0; r <
rounds; r++) {
439template < const
int LX >
520 for (
int r = 0; r <
rounds; r++) {
#define CASE_KSTEP_SEL(LX, SEL)
void cuda_ax_helm_vector_part2(void *au, void *av, void *aw, void *u, void *v, void *w, void *h2, void *B, int *n)
#define CASE_1D_SEL(LX, SEL)
int tune(void *w, void *u, void *dx, void *dy, void *dz, void *dxt, void *dyt, void *dzt, void *h1, void *g11, void *g22, void *g33, void *g12, void *g13, void *g23, int *nelv, int *lx, int *eb_sel, int *ch_sel)
void cuda_ax_helm(void *w, void *u, void *dx, void *dy, void *dz, void *dxt, void *dyt, void *dzt, void *h1, void *g11, void *g22, void *g33, void *g12, void *g13, void *g23, int *nelv, int *lx)
void cuda_ax_helm_vector(void *au, void *av, void *aw, void *u, void *v, void *w, void *dx, void *dy, void *dz, void *dxt, void *dyt, void *dzt, void *h1, void *g11, void *g22, void *g33, void *g12, void *g13, void *g23, int *nelv, int *lx)
#define CASE_KSTEP(LX, C)
#define CASE_KSTEP_PADDED_SEL(LX, SEL)
#define CASE_LARGE_PADDED(LX)
int tune_padded(void *w, void *u, void *dx, void *dy, void *dz, void *dxt, void *dyt, void *dzt, void *h1, void *g11, void *g22, void *g33, void *g12, void *g13, void *g23, int *nelv, int *lx, int *eb_sel, int *ch_sel)
#define CASE_VECTOR_PADDED(LX)
#define CASE_KSTEP_PADDED(LX, C)
__global__ void ale_add_kinematics_kernel(const int n, T *__restrict__ wx, T *__restrict__ wy, T *__restrict__ wz, const T *__restrict__ x_ref, const T *__restrict__ y_ref, const T *__restrict__ z_ref, const T *__restrict__ phi, const T *__restrict__ x, const T *__restrict__ y, const T *__restrict__ z, const kinematics_params_t kin_params)
__global__ void T *__restrict__ T *__restrict__ aw
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ w
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ u
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dx
__global__ void T *__restrict__ av
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ v
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dz
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ h1
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dy
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const int nelv
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ g23
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ g22
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ g13
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ g12
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ g33
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ g11
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dzt
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dyt
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dxt
#define NEKO_CHUNKS_CANDIDATES
#define NEKO_EB_CANDIDATES
#define NEKO_EB_SEL(LX, SEL)
#define NEKO_CHUNKS_SEL(LX, SEL)
#define NEKO_TUNE_TIME(T, LAUNCH, LX, C, ITERS)
static int neko_tune_rounds()
#define NEKO_TUNE_LOG(LX, T1, T2)
#define NEKO_TUNE_BEST(T, BEST, N)
static int neko_tune_iters()
static int neko_chunks_env()
static int neko_eb_sweep()
void log_error(char *msg)
void log_message(char *msg)
void log_section(char *msg)