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

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_DMMA(LX, C)
#define CASE_DMMA_SEL(LX, SEL)
#define CASE_DMMA_TMA(LX, C)
#define CASE_DMMA_TMA_SEL(LX, SEL)
#define CASE(LX)
#define CASE_LARGE(LX)

Functions

template<const int>
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 *nw_sel, int *tw_sel)
void cuda_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)

Macro Definition Documentation

◆ CASE

#define CASE ( LX)
Value:
case LX: \
if(autotune[LX] == 0 ) { \
autotune[LX]=tune_conv1<LX>(du, u, \
vx, vy, vz, \
dx, dy, dz, \
drdx, dsdx, dtdx, \
drdy, dsdy, dtdy, \
drdz, dsdz, dtdz, \
jacinv, nel, gdim, lx, &autotune_eb[LX], \
&autotune_ch[LX], &autotune_nw[LX], \
&autotune_tw[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_DMMA_SEL(LX, autotune_nw[LX]); \
} else if (autotune[LX] == 4 ) { \
CASE_DMMA_TMA_SEL(LX, autotune_tw[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__ 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__ 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__ vz
__global__ void const T *__restrict__ const T *__restrict__ vx
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ vy
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 *nw_sel, int *tw_sel)
Definition opr_conv1.cu:242

◆ CASE_1D

#define CASE_1D ( LX,
C )
Value:
<<<nblcks, NEKO_CHUNKS_NTHRDS(LX, C), 0, stream>>> \
((real *) du, (real *) u, \
(real *) vx, (real *) vy, (real *) vz, \
(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 *) jacinv); \
CUDA_CHECK(cudaGetLastError());
__global__ void conv1_kernel_1d(T *__restrict__ du, const T *__restrict__ u, const T *__restrict__ vx, const T *__restrict__ vy, const T *__restrict__ vz, 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__ jacinv)
#define NEKO_CHUNKS(LX, C)
Definition elem_block.h:145
#define NEKO_CHUNKS_NTHRDS(LX, C)
Definition elem_block.h:146
double real

◆ 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_DMMA

#define CASE_DMMA ( LX,
C )
Value:
conv1_kernel_dmma<real, LX, NEKO_DMMA_NW(C)> \
<<<NEKO_DMMA_NBLCKS(*nel, LX), NEKO_DMMA_NTHRDS(C), 0, stream>>> \
((real *) du, (real *) u, \
(real *) vx, (real *) vy, (real *) vz, \
(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 *) jacinv, *nel); \
CUDA_CHECK(cudaGetLastError());
#define NEKO_DMMA_NW(C)
#define NEKO_DMMA_NBLCKS(NELV, LX)
#define NEKO_DMMA_NTHRDS(C)

◆ CASE_DMMA_SEL

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

◆ CASE_DMMA_TMA

#define CASE_DMMA_TMA ( LX,
C )
Value:
(void) conv1_dmma_tma_optin<real, LX, NEKO_DMMA_NW(C)>(); \
conv1_kernel_dmma_tma<real, LX, NEKO_DMMA_NW(C)> \
<<<NEKO_DMMA_NBLCKS(*nel, LX), NEKO_DMMA_NTHRDS(C), \
NEKO_CONV1_TMA_SMEM, stream>>> \
((real *) du, (real *) u, \
(real *) vx, (real *) vy, (real *) vz, \
(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 *) jacinv); \
CUDA_CHECK(cudaGetLastError());
static bool conv1_dmma_tma_optin()
#define NEKO_CONV1_TMA_SMEM

◆ CASE_DMMA_TMA_SEL

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

◆ CASE_KSTEP

#define CASE_KSTEP ( LX,
C )
Value:
conv1_kernel_kstep<real, LX, NEKO_EB(LX, C)> \
<<<NEKO_EB_NBLCKS(*nel, LX, C), NEKO_EB_NTHRDS(LX, C), 0, stream>>> \
((real *) du, (real *) u, \
(real *) vx, (real *) vy, (real *) vz, \
(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 *) jacinv, *nel); \
CUDA_CHECK(cudaGetLastError());
#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_LARGE

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

Function Documentation

◆ cuda_conv1()

void cuda_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 )

Fortran wrapper for device cuda convective terms

Definition at line 62 of file opr_conv1.cu.

Here is the caller graph for this function:

◆ tune_conv1()

template<const int>
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 * nw_sel,
int * tw_sel )

Definition at line 242 of file opr_conv1.cu.

Here is the call graph for this function: