Neko 1.99.10
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
opr_opgrad.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 "opgrad_kernel.h"
#include "elem_block_tune.h"
#include <common/neko_log.h>
Include dependency graph for opr_opgrad.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_SEL(LX, SEL)
#define CASE_MFMA(LX, C)
#define CASE_MFMA_SEL(LX, SEL)
#define CASE(LX)

Functions

template<const int>
int tune_opgrad (void *ux, void *uy, void *uz, void *u, 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 *w3, int *nel, int *lx, int *eb_sel, int *ch_sel, int *nwf_sel)
void hip_opgrad (void *ux, void *uy, void *uz, void *u, 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 *w3, int *nel, int *lx)

Macro Definition Documentation

◆ CASE

#define CASE ( LX)
Value:
case LX: \
if(autotune[LX] == 0 ) { \
autotune[LX]=tune_opgrad<LX>(ux, uy, uz, u, \
dx, dy, dz, \
drdx, dsdx, dtdx, \
drdy, dsdy, dtdy, \
drdz, dsdz, dtdz, \
w3, nel, 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
__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 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__ dsdz
__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__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ w3
__global__ void T *__restrict__ uy
__global__ void T *__restrict__ T *__restrict__ uz
int tune_opgrad(void *ux, void *uy, void *uz, void *u, 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 *w3, int *nel, int *lx, int *eb_sel, int *ch_sel, int *nw_sel, int *tw_sel)

◆ CASE_1D

#define CASE_1D ( LX,
C )
Value:
hipLaunchKernelGGL( HIP_KERNEL_NAME( \
opgrad_kernel_1d<real, LX, NEKO_CHUNKS(LX, C)> ), \
nblcks, NEKO_CHUNKS_NTHRDS(LX, C), 0, \
(hipStream_t) glb_cmd_queue, \
(real *) ux, (real *) uy, (real *) uz, (real *) u, \
(real *) dx, (real *) dy, (real *) dz, \
(real *) drdx, (real *) dsdx, (real *) dtdx, \
(real *) drdy, (real *) dsdy, (real *) dtdy, \
(real *) drdz, (real *) dsdz, (real *) dtdz, \
(real *) w3); \
HIP_CHECK(hipGetLastError());
#define NEKO_CHUNKS(LX, C)
Definition elem_block.h:145
#define NEKO_CHUNKS_NTHRDS(LX, C)
Definition elem_block.h:146
__global__ void opgrad_kernel_1d(T *__restrict__ ux, T *__restrict__ uy, T *__restrict__ uz, const T *__restrict__ u, const T *__restrict__ dx, const T *__restrict__ dy, const T *__restrict__ dz, const T *__restrict__ drdx, const T *__restrict__ dsdx, const T *__restrict__ dtdx, const T *__restrict__ drdy, const T *__restrict__ dsdy, const T *__restrict__ dtdy, const T *__restrict__ drdz, const T *__restrict__ dsdz, const T *__restrict__ dtdz, const T *__restrict__ w3)
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( \
opgrad_kernel_kstep<real, LX, NEKO_EB(LX, C)> ), \
NEKO_EB_NBLCKS(*nel, LX, C), NEKO_EB_NTHRDS(LX, C), 0, \
(hipStream_t) glb_cmd_queue, \
(real *) ux, (real *) uy, (real *) uz, (real *) u, \
(real *) dx, (real *) dy, (real *) dz, \
(real *) drdx, (real *) dsdx, (real *) dtdx, \
(real *) drdy, (real *) dsdy, (real *) dtdy, \
(real *) drdz, (real *) dsdz, (real *) dtdz, \
(real *) w3, *nel); \
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_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_MFMA

#define CASE_MFMA ( LX,
C )
Value:
hipLaunchKernelGGL( HIP_KERNEL_NAME( \
opgrad_kernel_mfma<real, LX, NEKO_MFMA_NWF(C), \
NEKO_MFMA_TILE(C)> ), \
NEKO_MFMA_NBLCKS(*nel, LX, C), NEKO_MFMA_NTHRDS(C), 0, \
(hipStream_t) glb_cmd_queue, \
(real *) ux, (real *) uy, (real *) uz, (real *) u, \
(real *) dx, (real *) dy, (real *) dz, \
(real *) drdx, (real *) dsdx, (real *) dtdx, \
(real *) drdy, (real *) dsdy, (real *) dtdy, \
(real *) drdz, (real *) dsdz, (real *) dtdz, \
(real *) w3, *nel); \
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)

Function Documentation

◆ hip_opgrad()

void hip_opgrad ( void * ux,
void * uy,
void * uz,
void * u,
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 * w3,
int * nel,
int * lx )

Fortran wrapper for device hip convective terms

Definition at line 62 of file opr_opgrad.hip.

◆ tune_opgrad()

template<const int>
int tune_opgrad ( void * ux,
void * uy,
void * uz,
void * u,
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 * w3,
int * nel,
int * lx,
int * eb_sel,
int * ch_sel,
int * nwf_sel )

Definition at line 209 of file opr_opgrad.hip.

Here is the call graph for this function: