38#include <hip/hip_runtime.h>
50 void *
dr,
void *
ds,
void *
dt,
51 void *
dx,
void *
dy,
void *
dz,
61 void *
dr,
void *
ds,
void *
dt,
62 void *
dx,
void *
dy,
void *
dz,
63 void *
jacinv,
int *nel,
int *lx) {
77#define CASE_1D(LX, C) \
78 hipLaunchKernelGGL( HIP_KERNEL_NAME( \
79 dudxyz_kernel_1d<real, LX, NEKO_CHUNKS(LX, C)> ), \
80 nblcks, NEKO_CHUNKS_NTHRDS(LX, C), 0, \
81 (hipStream_t) glb_cmd_queue, \
82 (real *) du, (real *) u, \
83 (real *) dr, (real *) ds, (real *) dt, \
84 (real *) dx, (real *) dy, (real *) dz, \
86 HIP_CHECK(hipGetLastError());
89#define CASE_1D_SEL(LX, SEL) \
91 case 0: CASE_1D(LX, 0); break; \
92 case 1: CASE_1D(LX, 1); break; \
93 case 2: CASE_1D(LX, 2); break; \
94 default: CASE_1D(LX, 3); break; \
97#define CASE_KSTEP(LX, C) \
98 hipLaunchKernelGGL( HIP_KERNEL_NAME( \
99 dudxyz_kernel_kstep<real, LX, NEKO_EB(LX, C)> ), \
100 NEKO_EB_NBLCKS(*nel, LX, C), NEKO_EB_NTHRDS(LX, C), 0, \
101 (hipStream_t) glb_cmd_queue, \
102 (real *) du, (real *) u, \
103 (real *) dr, (real *) ds, (real *) dt, \
104 (real *) dx, (real *) dy, (real *) dz, \
105 (real *) jacinv, *nel); \
106 HIP_CHECK(hipGetLastError());
109#define CASE_KSTEP_SEL(LX, SEL) \
111 case 0: CASE_KSTEP(LX, 0); break; \
112 case 1: CASE_KSTEP(LX, 1); break; \
113 default: CASE_KSTEP(LX, 2); break; \
116#define CASE_MFMA(LX, C) \
117 hipLaunchKernelGGL( HIP_KERNEL_NAME( \
118 dudxyz_kernel_mfma<real, LX, NEKO_MFMA_NWF(C)> ), \
119 NEKO_MFMA_NBLCKS(*nel, LX, C), NEKO_MFMA_NTHRDS(C), 0, \
120 (hipStream_t) glb_cmd_queue, \
121 (real *) du, (real *) u, \
122 (real *) dr, (real *) ds, (real *) dt, \
123 (real *) dx, (real *) dy, (real *) dz, \
124 (real *) jacinv, *nel); \
125 HIP_CHECK(hipGetLastError());
128#define CASE_MFMA_SEL(LX, SEL) \
130 case 0: CASE_MFMA(LX, 0); break; \
131 case 1: CASE_MFMA(LX, 1); break; \
132 case 2: CASE_MFMA(LX, 2); break; \
133 default: CASE_MFMA(LX, 3); break; \
138 if(autotune[LX] == 0 ) { \
139 autotune[LX]=tune_dudxyz<LX>(du, u, \
142 jacinv, nel, lx, &autotune_eb[LX], \
144 &autotune_nwf[LX]); \
145 } else if (autotune[LX] == 1 ) { \
146 CASE_1D_SEL(LX, autotune_ch[LX]); \
147 } else if (autotune[LX] == 2 ) { \
148 CASE_KSTEP_SEL(LX, autotune_eb[LX]); \
149 } else if (autotune[LX] == 3 ) { \
150 CASE_MFMA_SEL(LX, autotune_nwf[LX]); \
154#define CASE_LARGE(LX) \
196template < const
int LX >
198 void *
dr,
void *
ds,
void *
dt,
199 void *
dx,
void *
dy,
void *
dz,
306 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__ 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__ 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 const T *__restrict__ const T *__restrict__ const T *__restrict__ ds
__global__ void const T *__restrict__ const T *__restrict__ dr
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dt
#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)
#define CASE_1D_SEL(LX, SEL)
#define CASE_MFMA_SEL(LX, SEL)
#define CASE_KSTEP(LX, C)
int tune_dudxyz(void *du, void *u, void *dr, void *ds, void *dt, void *dx, void *dy, void *dz, void *jacinv, int *nel, int *lx, int *eb_sel, int *ch_sel, int *nwf_sel)
void hip_dudxyz(void *du, void *u, void *dr, void *ds, void *dt, void *dx, void *dy, void *dz, void *jacinv, int *nel, int *lx)