1#ifndef __MATH_CDTP_KERNEL_H__
2#define __MATH_CDTP_KERNEL_H__
45template<
typename T, const
int LX, const
int CHUNKS >
75 while(l < (
LX *
LX *
LX)) {
86 for (
int n = 0; n <
nchunks; n++) {
90 const int k =
jk /
LX;
96 for (
int l = 0; l <
LX; l++) {
107template<
typename T, const
int LX, const
int EB >
127 static_assert(
sizeof(
shdxt) +
133 "kstep block exceeds the shared memory budget");
171 for (
int k = 0;
k <
LX; ++
k) {
177 for (
int l = 0; l <
LX; l++) {
185 for (
int l = 0; l <
LX; l++) {
229#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 800) && (__CUDA_ARCH__ < 1000)
231template< const
int LX, const
int NW >
277 const int wf =
tid >> 5;
278 const int ebase = pack::ebase();
304 const int i = p %
LX;
305 const int l = p /
LX;
307 for (
int b = 0; b <
PPA; b++) {
308 const int m = (b *
LX +
i) +
DMMA_P * (b *
LX + l);
318 const int gp = idx.g;
319 const double wx =
x[
gp] *
w3[idx.l];
358template<
typename T, const
int LX, const
int NW >
368#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 800) && (__CUDA_ARCH__ < 1000)
371#define NEKO_CDTP_DMMA_DISPATCH(LXV) \
372 template< const int NW > \
373 struct cdtp_dmma_dispatch< double, LXV, NW > { \
374 __device__ static void run(double * __restrict__ dtx, \
375 const double * __restrict__ x, \
376 const double * __restrict__ dr, \
377 const double * __restrict__ ds, \
378 const double * __restrict__ dt, \
379 const double * __restrict__ dxt, \
380 const double * __restrict__ dyt, \
381 const double * __restrict__ dzt, \
382 const double * __restrict__ w3, \
384 cdtp_dmma_elem< LXV, NW >(dtx, x, dr, ds, dt, \
385 dxt, dyt, dzt, w3, nelv); \
399template<
typename T, const
int LX, const
int NW >
445#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 900) && \
446 (__CUDA_ARCH__ < 1000) && NEKO_TMA_TOOLKIT
448template< const
int LX, const
int NW >
499 const int wf =
tid >> 5;
547 const double wx =
shx[p] *
w3[p];
583template<
typename T, const
int LX, const
int NW >
592#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 900) && \
593 (__CUDA_ARCH__ < 1000) && NEKO_TMA_TOOLKIT
596#define NEKO_CDTP_DMMA_TMA_DISPATCH(LXV) \
597 template< const int NW > \
598 struct cdtp_dmma_tma_dispatch< double, LXV, NW > { \
599 __device__ static void run(double * __restrict__ dtx, \
600 const double * __restrict__ x, \
601 const double * __restrict__ dr, \
602 const double * __restrict__ ds, \
603 const double * __restrict__ dt, \
604 const double * __restrict__ dxt, \
605 const double * __restrict__ dyt, \
606 const double * __restrict__ dzt, \
607 const double * __restrict__ w3) { \
608 cdtp_dmma_tma_elem< LXV, NW >(dtx, x, dr, ds, dt, \
609 dxt, dyt, dzt, w3); \
617template<
typename T, const
int LX, const
int NW >
__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 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__ ds
__shared__ T shdzt[LX *LX]
__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__ x
__global__ void const T *__restrict__ const T *__restrict__ dr
__shared__ T shtar[EB *LX *LX]
__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 int nelv
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dt
__shared__ T shtas[EB *LX *LX]
__global__ void cdtp_kernel_1d(T *__restrict__ dtx, const T *__restrict__ x, const T *__restrict__ dr, const T *__restrict__ ds, const T *__restrict__ dt, const T *__restrict__ dxt, const T *__restrict__ dyt, const T *__restrict__ dzt, const T *__restrict__ w3)
__shared__ T shdyt[LX *LX]
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dxt
__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
#define NEKO_EB_BOUNDS(NT)
static __device__ void run(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)
static __device__ void run(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__)