38#include <hip/hip_runtime.h>
50 void *
vx,
void *
vy,
void *
vz,
51 void *
dx,
void *
dy,
void *
dz,
64 void *
vx,
void *
vy,
void *
vz,
65 void *
dx,
void *
dy,
void *
dz,
69 void *
jacinv,
int *nel,
int *gdim,
int *lx) {
83#define CASE_1D(LX, C) \
84 hipLaunchKernelGGL( HIP_KERNEL_NAME( \
85 conv1_kernel_1d<real, LX, NEKO_CHUNKS(LX, C)> ), \
86 nblcks, NEKO_CHUNKS_NTHRDS(LX, C), 0, \
87 (hipStream_t) glb_cmd_queue, \
88 (real *) du, (real *) u, \
89 (real *) vx, (real *) vy, (real *) vz, \
90 (real *) dx, (real *) dy, (real *) dz, \
91 (real *) drdx, (real *) dsdx, (real *) dtdx, \
92 (real *) drdy, (real *) dsdy, (real *) dtdy, \
93 (real *) drdz, (real *) dsdz, (real *) dtdz, \
95 HIP_CHECK(hipGetLastError());
98#define CASE_1D_SEL(LX, SEL) \
100 case 0: CASE_1D(LX, 0); break; \
101 case 1: CASE_1D(LX, 1); break; \
102 case 2: CASE_1D(LX, 2); break; \
103 default: CASE_1D(LX, 3); break; \
106#define CASE_KSTEP(LX, C) \
107 hipLaunchKernelGGL( HIP_KERNEL_NAME( \
108 conv1_kernel_kstep<real, LX, NEKO_EB(LX, C)> ), \
109 NEKO_EB_NBLCKS(*nel, LX, C), NEKO_EB_NTHRDS(LX, C), 0, \
110 (hipStream_t) glb_cmd_queue, \
111 (real *) du, (real *) u, \
112 (real *) vx, (real *) vy, (real *) vz, \
113 (real *) dx, (real *) dy, (real *) dz, \
114 (real *) drdx, (real *) dsdx, (real *) dtdx, \
115 (real *) drdy, (real *) dsdy, (real *) dtdy, \
116 (real *) drdz, (real *) dsdz, (real *) dtdz, \
117 (real *) jacinv, *nel); \
118 HIP_CHECK(hipGetLastError());
121#define CASE_KSTEP_SEL(LX, SEL) \
123 case 0: CASE_KSTEP(LX, 0); break; \
124 case 1: CASE_KSTEP(LX, 1); break; \
125 default: CASE_KSTEP(LX, 2); break; \
128#define CASE_MFMA(LX, C) \
129 hipLaunchKernelGGL( HIP_KERNEL_NAME( \
130 conv1_kernel_mfma<real, LX, NEKO_MFMA_NWF(C)> ), \
131 NEKO_MFMA_NBLCKS(*nel, LX, C), NEKO_MFMA_NTHRDS(C), 0, \
132 (hipStream_t) glb_cmd_queue, \
133 (real *) du, (real *) u, \
134 (real *) vx, (real *) vy, (real *) vz, \
135 (real *) dx, (real *) dy, (real *) dz, \
136 (real *) drdx, (real *) dsdx, (real *) dtdx, \
137 (real *) drdy, (real *) dsdy, (real *) dtdy, \
138 (real *) drdz, (real *) dsdz, (real *) dtdz, \
139 (real *) jacinv, *nel); \
140 HIP_CHECK(hipGetLastError());
143#define CASE_MFMA_SEL(LX, SEL) \
145 case 0: CASE_MFMA(LX, 0); break; \
146 case 1: CASE_MFMA(LX, 1); break; \
147 case 2: CASE_MFMA(LX, 2); break; \
148 default: CASE_MFMA(LX, 3); break; \
153 if(autotune[LX] == 0 ) { \
154 autotune[LX]=tune_conv1<LX>(du, u, \
160 jacinv, nel, gdim, lx, &autotune_eb[LX], \
162 &autotune_nwf[LX]); \
163 } else if (autotune[LX] == 1 ) { \
164 CASE_1D_SEL(LX, autotune_ch[LX]); \
165 } else if (autotune[LX] == 2 ) { \
166 CASE_KSTEP_SEL(LX, autotune_eb[LX]); \
167 } else if (autotune[LX] == 3 ) { \
168 CASE_MFMA_SEL(LX, autotune_nwf[LX]); \
172#define CASE_LARGE(LX) \
214template < const
int LX >
216 void *
vx,
void *
vy,
void *
vz,
217 void *
dx,
void *
dy,
void *
dz,
221 void *
jacinv,
int *nel,
int *gdim,
int *lx,
int *
eb_sel,
326 for (
int r = 0; r <
rounds; r++) {
__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__ 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 T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dtdy
__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__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dtdx
__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__ 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__ dtdz
__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__ 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__ jacinv
__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__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dsdz
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dx
__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__ const T *__restrict__ dy
__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__ const T *__restrict__ const T *__restrict__ const T *__restrict__ drdz
__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__ const T *__restrict__ drdx
__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__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dsdx
__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__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dsdy
__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__ const T *__restrict__ const T *__restrict__ drdy
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ vz
__global__ void const T *__restrict__ const T *__restrict__ vx
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ vy
#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()
#define NEKO_TUNE_LOG_MFMA(LX, T3)
#define NEKO_MFMA_CANDIDATES
static bool hip_have_mfma()
static int neko_mfma_env()
#define NEKO_MFMA_EB(LX, C)
static int neko_mfma_sweep()
void log_error(char *msg)
void log_message(char *msg)
void log_section(char *msg)
#define CASE_KSTEP_SEL(LX, SEL)
int tune_conv1(void *du, void *u, void *vx, void *vy, void *vz, void *dx, void *dy, void *dz, void *drdx, void *dsdx, void *dtdx, void *drdy, void *dsdy, void *dtdy, void *drdz, void *dsdz, void *dtdz, void *jacinv, int *nel, int *gdim, int *lx, int *eb_sel, int *ch_sel, int *nwf_sel)
#define CASE_1D_SEL(LX, SEL)
void hip_conv1(void *du, void *u, void *vx, void *vy, void *vz, void *dx, void *dy, void *dz, void *drdx, void *dsdx, void *dtdx, void *drdy, void *dsdy, void *dtdy, void *drdz, void *dsdz, void *dtdz, void *jacinv, int *nel, int *gdim, int *lx)
#define CASE_MFMA_SEL(LX, SEL)
#define CASE_KSTEP(LX, C)