Neko 1.99.10
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
ax_helm_compr.hip File Reference
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <hip/hip_runtime.h>
#include <device/device_config.h>
#include <device/hip/check.h>
#include "ax_helm_compr_kernel.h"
#include "elem_block_tune.h"
#include <common/neko_log.h>
Include dependency graph for ax_helm_compr.hip:

Go to the source code of this file.

Macros

#define CASE_1D(LX, C)
#define CASE_1D_SEL(LX, SEL)
#define CASE_KSTEP(LX, C)
#define CASE_KSTEP_PADDED(LX, C)
#define CASE_MFMA(LX, C)
#define CASE_MFMA_SEL(LX, SEL)
#define CASE_KSTEP_SEL(LX, SEL)
#define CASE_KSTEP_PADDED_SEL(LX, SEL)
#define CASE(LX)
#define CASE_PADDED(LX)
#define CASE_LARGE(LX)
#define CASE_LARGE_PADDED(LX)
#define CASE_VECTOR_KSTEP(LX, C)
#define CASE_VECTOR_KSTEP_PADDED(LX, C)
#define CASE_VECTOR_MFMA(LX, C)
#define CASE_VECTOR_KSTEP_SEL(LX, SEL)
#define CASE_VECTOR_KSTEP_PADDED_SEL(LX, SEL)
#define CASE_VECTOR_MFMA_SEL(LX, SEL)
#define CASE_VECTOR(LX)
#define CASE_VECTOR_PADDED(LX)

Functions

template<const int>
int tune_compr (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, void *ind, int *nelv, int *lx, int *eb_sel, int *ch_sel, int *nwf_sel)
template<const int>
int tune_compr_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, void *ind, int *nelv, int *lx, int *eb_sel, int *ch_sel, int *nwf_sel)
template<const int>
int tune_compr_vector (void *au, void *av, void *aw, void *u, void *v, void *w, void *dx, void *dy, void *dz, void *h1, void *g11, void *g22, void *g33, void *g12, void *g13, void *g23, void *ind, int *nelv, int *lx, int *eb_sel, int *nwf_sel)
template<const int>
int tune_compr_vector_padded (void *au, void *av, void *aw, void *u, void *v, void *w, void *dx, void *dy, void *dz, void *h1, void *g11, void *g22, void *g33, void *g12, void *g13, void *g23, void *ind, int *nelv, int *lx, int *eb_sel, int *nwf_sel)
void hip_ax_helm_compr (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, void *ind, int *nelv, int *lx)
void hip_ax_helm_compr_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, void *ind, int *nelv, int *lx)

Macro Definition Documentation

◆ CASE

#define CASE ( LX)
Value:
case LX: \
if(autotune[LX] == 0 ) { \
autotune[LX]=tune_compr<LX>( w, u, \
dx, dy, dz, \
dxt, dyt, dzt,h1, \
g11, g22, g33, \
g12, g13, g23, ind, nelv, lx, \
&autotune_eb[LX], &autotune_ch[LX], \
&autotune_nwf[LX]); \
} else if (autotune[LX] == 1 ) { \
CASE_1D_SEL(LX, autotune_ch[LX]); \
} else if (autotune[LX] == 2 ) { \
CASE_KSTEP_SEL(LX, autotune_eb[LX]); \
} else if (autotune[LX] == 3 ) { \
CASE_MFMA_SEL(LX, autotune_nwf[LX]); \
} \
break
int tune_compr(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, void *ind, int *nelv, int *lx, int *eb_sel, int *ch_sel, int *nw_sel, int *tw_sel)
__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__ const T *__restrict__ const int *__restrict__ ind
__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 T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ w
__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 *__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__ g12
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dz
__global__ void const T *__restrict__ const T *__restrict__ dx
__global__ void const T *__restrict__ u
__global__ void 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__ 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__ h1
__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__ const T *__restrict__ const T *__restrict__ dzt
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dxt

◆ CASE_1D

#define CASE_1D ( LX,
C )
Value:
hipLaunchKernelGGL(HIP_KERNEL_NAME( \
nblcks_1d, NEKO_CHUNKS_NTHRDS(LX, C), 0, \
(hipStream_t) glb_cmd_queue, \
(real *) w, (real *) u, \
(real *) dx, (real *) dy, (real *) dz, \
(real *) dxt, (real *) dyt, (real *) dzt, (real *) h1, \
(real *) g11, (real *) g22, (real *) g33, \
(real *) g12, (real *) g13, (real *) g23, (int *) ind); \
HIP_CHECK(hipGetLastError());
__global__ void ax_helm_compr_kernel_1d(T *__restrict__ w, const T *__restrict__ u, const T *__restrict__ dx, const T *__restrict__ dy, const T *__restrict__ dz, const T *__restrict__ dxt, const T *__restrict__ dyt, const T *__restrict__ dzt, const T *__restrict__ h1, const T *__restrict__ g11, const T *__restrict__ g22, const T *__restrict__ g33, const T *__restrict__ g12, const T *__restrict__ g13, const T *__restrict__ g23, const int *__restrict__ ind)
#define NEKO_CHUNKS(LX, C)
Definition elem_block.h:145
#define NEKO_CHUNKS_NTHRDS(LX, C)
Definition elem_block.h:146
double real
void * glb_cmd_queue

◆ CASE_1D_SEL

#define CASE_1D_SEL ( LX,
SEL )
Value:
switch (SEL) { \
case 0: CASE_1D(LX, 0); break; \
case 1: CASE_1D(LX, 1); break; \
case 2: CASE_1D(LX, 2); break; \
default: CASE_1D(LX, 3); break; \
}
#define CASE_1D(LX, C)

◆ CASE_KSTEP

#define CASE_KSTEP ( LX,
C )
Value:
hipLaunchKernelGGL( HIP_KERNEL_NAME( \
ax_helm_compr_kernel_kstep<real, LX, \
NEKO_EB(LX, C)> ), \
NEKO_EB_NBLCKS(*nelv, LX, C), NEKO_EB_NTHRDS(LX, C), 0, \
(hipStream_t) glb_cmd_queue, \
(real *) w, (real *) u, \
(real *) dx, (real *) dy, (real *) dz, (real *) h1, \
(real *) g11, (real *) g22, (real *) g33, \
(real *) g12, (real *) g13, (real *) g23, \
(int *) ind, *nelv); \
HIP_CHECK(hipGetLastError());
#define NEKO_EB(LX, C)
Definition elem_block.h:104
#define NEKO_EB_NBLCKS(NELV, LX, C)
Definition elem_block.h:106
#define NEKO_EB_NTHRDS(LX, C)
Definition elem_block.h:105

◆ CASE_KSTEP_PADDED

#define CASE_KSTEP_PADDED ( LX,
C )
Value:
hipLaunchKernelGGL( HIP_KERNEL_NAME( \
ax_helm_compr_kernel_kstep_padded<real, LX, \
NEKO_EB(LX, C)> ), \
NEKO_EB_NBLCKS(*nelv, LX, C), NEKO_EB_NTHRDS(LX, C), 0, \
(hipStream_t) glb_cmd_queue, \
(real *) w, (real *) u, \
(real *) dx, (real *) dy, (real *) dz, (real *) h1, \
(real *) g11, (real *) g22, (real *) g33, \
(real *) g12, (real *) g13, (real *) g23, \
(int *) ind, *nelv); \
HIP_CHECK(hipGetLastError());

◆ CASE_KSTEP_PADDED_SEL

#define CASE_KSTEP_PADDED_SEL ( LX,
SEL )
Value:
switch (SEL) { \
case 0: CASE_KSTEP_PADDED(LX, 0); break; \
case 1: CASE_KSTEP_PADDED(LX, 1); break; \
default: CASE_KSTEP_PADDED(LX, 2); break; \
}
#define CASE_KSTEP_PADDED(LX, C)

◆ CASE_KSTEP_SEL

#define CASE_KSTEP_SEL ( LX,
SEL )
Value:
switch (SEL) { \
case 0: CASE_KSTEP(LX, 0); break; \
case 1: CASE_KSTEP(LX, 1); break; \
default: CASE_KSTEP(LX, 2); break; \
}
#define CASE_KSTEP(LX, C)

◆ CASE_LARGE

#define CASE_LARGE ( LX)
Value:
case LX: \
CASE_KSTEP(LX, 0); \
break

◆ CASE_LARGE_PADDED

#define CASE_LARGE_PADDED ( LX)
Value:
case LX: \
CASE_KSTEP_PADDED(LX, 0); \
break

◆ CASE_MFMA

#define CASE_MFMA ( LX,
C )
Value:
hipLaunchKernelGGL( HIP_KERNEL_NAME( \
ax_helm_compr_kernel_mfma<real, LX, NEKO_MFMA_NWF(C), \
NEKO_MFMA_TILE(C)> ), \
(hipStream_t) glb_cmd_queue, \
(real *) w, (real *) u, \
(real *) dx, (real *) dy, (real *) dz, (real *) h1, \
(real *) g11, (real *) g22, (real *) g33, \
(real *) g12, (real *) g13, (real *) g23, \
(int *) ind, *nelv); \
HIP_CHECK(hipGetLastError());
#define NEKO_MFMA_NWF(C)
#define NEKO_MFMA_NTHRDS(C)
#define NEKO_MFMA_TILE(C)
#define NEKO_MFMA_NBLCKS(NELV, LX, C)

◆ CASE_MFMA_SEL

#define CASE_MFMA_SEL ( LX,
SEL )
Value:
switch (SEL) { \
case 0: CASE_MFMA(LX, 0); break; \
case 1: CASE_MFMA(LX, 1); break; \
case 2: CASE_MFMA(LX, 2); break; \
case 3: CASE_MFMA(LX, 3); break; \
case 4: CASE_MFMA(LX, 4); break; \
case 5: CASE_MFMA(LX, 5); break; \
case 6: CASE_MFMA(LX, 6); break; \
case 7: CASE_MFMA(LX, 7); break; \
case 8: CASE_MFMA(LX, 8); break; \
default: CASE_MFMA(LX, 9); break; \
}
#define CASE_MFMA(LX, C)

◆ CASE_PADDED

#define CASE_PADDED ( LX)
Value:
case LX: \
if(autotune[LX] == 0 ) { \
autotune[LX]=tune_compr_padded<LX>(w, u, \
dx, dy, dz, \
dxt, dyt, dzt,h1, \
g11, g22, g33, \
g12, g13, g23, ind, nelv,lx, \
&autotune_eb[LX], &autotune_ch[LX], \
&autotune_nwf[LX]); \
} else if (autotune[LX] == 1 ) { \
CASE_1D_SEL(LX, autotune_ch[LX]); \
} else if (autotune[LX] == 2 ) { \
CASE_KSTEP_PADDED_SEL(LX, autotune_eb[LX]); \
} else if (autotune[LX] == 3 ) { \
CASE_MFMA_SEL(LX, autotune_nwf[LX]); \
} \
break
int tune_compr_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, void *ind, int *nelv, int *lx, int *eb_sel, int *ch_sel, int *nw_sel, int *tw_sel)

◆ CASE_VECTOR

#define CASE_VECTOR ( LX)
Value:
case LX: \
if (autotune_v[LX] == 0) { \
autotune_v[LX] = tune_compr_vector<LX>(au, av, aw, u, v, w, \
dx, dy, dz, h1, \
g11, g22, g33, \
g12, g13, g23, ind, nelv, lx, \
&autotune_v_eb[LX], \
&autotune_v_nwf[LX]); \
} else if (autotune_v[LX] == 2) { \
CASE_VECTOR_KSTEP_SEL(LX, autotune_v_eb[LX]); \
} else if (autotune_v[LX] == 3) { \
CASE_VECTOR_MFMA_SEL(LX, autotune_v_nwf[LX]); \
} \
break
int tune_compr_vector(void *au, void *av, void *aw, void *u, void *v, void *w, void *dx, void *dy, void *dz, void *h1, void *g11, void *g22, void *g33, void *g12, void *g13, void *g23, void *ind, int *nelv, int *lx, int *eb_sel, int *nw_sel, int *tw_sel, int *bw_sel)
__global__ void T *__restrict__ T *__restrict__ aw
__global__ void T *__restrict__ av
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ v

◆ CASE_VECTOR_KSTEP

#define CASE_VECTOR_KSTEP ( LX,
C )
Value:
hipLaunchKernelGGL( HIP_KERNEL_NAME( \
ax_helm_compr_kernel_vector_kstep<real, LX, \
NEKO_EB(LX, C)> ), \
NEKO_EB_NBLCKS(*nelv, LX, C), NEKO_EB_NTHRDS(LX, C), 0, \
(hipStream_t) glb_cmd_queue, \
(real *) au, (real *) av, (real *) aw, \
(real *) u, (real *) v, (real *) w, \
(real *) dx, (real *) dy, (real *) dz, (real *) h1, \
(real *) g11, (real *) g22, (real *) g33, \
(real *) g12, (real *) g13, (real *) g23, \
(int *) ind, *nelv); \
HIP_CHECK(hipGetLastError());

◆ CASE_VECTOR_KSTEP_PADDED

#define CASE_VECTOR_KSTEP_PADDED ( LX,
C )
Value:
hipLaunchKernelGGL( HIP_KERNEL_NAME( \
ax_helm_compr_kernel_vector_kstep_padded< \
real, LX, NEKO_EB(LX, C)> ), \
NEKO_EB_NBLCKS(*nelv, LX, C), NEKO_EB_NTHRDS(LX, C), 0, \
(hipStream_t) glb_cmd_queue, \
(real *) au, (real *) av, (real *) aw, \
(real *) u, (real *) v, (real *) w, \
(real *) dx, (real *) dy, (real *) dz, (real *) h1, \
(real *) g11, (real *) g22, (real *) g33, \
(real *) g12, (real *) g13, (real *) g23, \
(int *) ind, *nelv); \
HIP_CHECK(hipGetLastError());

◆ CASE_VECTOR_KSTEP_PADDED_SEL

#define CASE_VECTOR_KSTEP_PADDED_SEL ( LX,
SEL )
Value:
switch (SEL) { \
case 0: CASE_VECTOR_KSTEP_PADDED(LX, 0); break; \
case 1: CASE_VECTOR_KSTEP_PADDED(LX, 1); break; \
default: CASE_VECTOR_KSTEP_PADDED(LX, 2); break; \
}
#define CASE_VECTOR_KSTEP_PADDED(LX, C)

◆ CASE_VECTOR_KSTEP_SEL

#define CASE_VECTOR_KSTEP_SEL ( LX,
SEL )
Value:
switch (SEL) { \
case 0: CASE_VECTOR_KSTEP(LX, 0); break; \
case 1: CASE_VECTOR_KSTEP(LX, 1); break; \
default: CASE_VECTOR_KSTEP(LX, 2); break; \
}
#define CASE_VECTOR_KSTEP(LX, C)

◆ CASE_VECTOR_MFMA

#define CASE_VECTOR_MFMA ( LX,
C )
Value:
hipLaunchKernelGGL( HIP_KERNEL_NAME( \
ax_helm_compr_kernel_mfma_vector< \
real, LX, NEKO_MFMA_NWF(C), NEKO_MFMA_TILE(C)> ), \
(hipStream_t) glb_cmd_queue, \
(real *) au, (real *) av, (real *) aw, \
(real *) u, (real *) v, (real *) w, \
(real *) dx, (real *) dy, (real *) dz, (real *) h1, \
(real *) g11, (real *) g22, (real *) g33, \
(real *) g12, (real *) g13, (real *) g23, \
(int *) ind, *nelv); \
HIP_CHECK(hipGetLastError());

◆ CASE_VECTOR_MFMA_SEL

#define CASE_VECTOR_MFMA_SEL ( LX,
SEL )
Value:
switch (SEL) { \
case 0: CASE_VECTOR_MFMA(LX, 0); break; \
case 1: CASE_VECTOR_MFMA(LX, 1); break; \
case 2: CASE_VECTOR_MFMA(LX, 2); break; \
case 3: CASE_VECTOR_MFMA(LX, 3); break; \
case 4: CASE_VECTOR_MFMA(LX, 4); break; \
case 5: CASE_VECTOR_MFMA(LX, 5); break; \
case 6: CASE_VECTOR_MFMA(LX, 6); break; \
case 7: CASE_VECTOR_MFMA(LX, 7); break; \
case 8: CASE_VECTOR_MFMA(LX, 8); break; \
default: CASE_VECTOR_MFMA(LX, 9); break; \
}
#define CASE_VECTOR_MFMA(LX, C)

◆ CASE_VECTOR_PADDED

#define CASE_VECTOR_PADDED ( LX)
Value:
case LX: \
if (autotune_v[LX] == 0) { \
autotune_v[LX] = tune_compr_vector_padded<LX>(au, av, aw, u, v, w, \
dx, dy, dz, h1, \
g11, g22, g33, \
g12, g13, g23, ind, \
nelv, lx, \
&autotune_v_eb[LX], \
&autotune_v_nwf[LX]); \
} else if (autotune_v[LX] == 2) { \
CASE_VECTOR_KSTEP_PADDED_SEL(LX, autotune_v_eb[LX]); \
} else if (autotune_v[LX] == 3) { \
CASE_VECTOR_MFMA_SEL(LX, autotune_v_nwf[LX]); \
} \
break
int tune_compr_vector_padded(void *au, void *av, void *aw, void *u, void *v, void *w, void *dx, void *dy, void *dz, void *h1, void *g11, void *g22, void *g33, void *g12, void *g13, void *g23, void *ind, int *nelv, int *lx, int *eb_sel, int *nw_sel, int *tw_sel, int *bw_sel)

Function Documentation

◆ hip_ax_helm_compr()

void hip_ax_helm_compr ( 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,
void * ind,
int * nelv,
int * lx )

Fortran wrapper for device HIP Ax on compressed geometric factors

Definition at line 93 of file ax_helm_compr.hip.

◆ hip_ax_helm_compr_vector()

void hip_ax_helm_compr_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,
void * ind,
int * nelv,
int * lx )

Fortran wrapper for device HIP Ax vector version on compressed geometric factors

Definition at line 301 of file ax_helm_compr.hip.

◆ tune_compr()

template<const int>
int tune_compr ( 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,
void * ind,
int * nelv,
int * lx,
int * eb_sel,
int * ch_sel,
int * nwf_sel )

Definition at line 462 of file ax_helm_compr.hip.

Here is the call graph for this function:

◆ tune_compr_padded()

template<const int>
int tune_compr_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,
void * ind,
int * nelv,
int * lx,
int * eb_sel,
int * ch_sel,
int * nwf_sel )

Definition at line 711 of file ax_helm_compr.hip.

Here is the call graph for this function:

◆ tune_compr_vector()

template<const int>
int tune_compr_vector ( void * au,
void * av,
void * aw,
void * u,
void * v,
void * w,
void * dx,
void * dy,
void * dz,
void * h1,
void * g11,
void * g22,
void * g33,
void * g12,
void * g13,
void * g23,
void * ind,
int * nelv,
int * lx,
int * eb_sel,
int * nwf_sel )

Definition at line 962 of file ax_helm_compr.hip.

Here is the call graph for this function:

◆ tune_compr_vector_padded()

template<const int>
int tune_compr_vector_padded ( void * au,
void * av,
void * aw,
void * u,
void * v,
void * w,
void * dx,
void * dy,
void * dz,
void * h1,
void * g11,
void * g22,
void * g33,
void * g12,
void * g13,
void * g23,
void * ind,
int * nelv,
int * lx,
int * eb_sel,
int * nwf_sel )

Definition at line 1165 of file ax_helm_compr.hip.

Here is the call graph for this function: