1#ifndef __MATH_DMMA_KERNEL_H__
2#define __MATH_DMMA_KERNEL_H__
101#include <cuda_runtime.h>
123#define NEKO_DMMA_CANDIDATES 3
124#define NEKO_DMMA_NW(C) (1 << ((C) + 1))
125#define NEKO_DMMA_NTHRDS(C) dim3(32 * NEKO_DMMA_NW(C), 1, 1)
147#define NEKO_DMMA_PPA(LX) ((DMMA_P % (LX) == 0) ? (DMMA_P / (LX)) : 1)
148#define NEKO_DMMA_PACK(LX) \
149 (NEKO_DMMA_PPA(LX) * NEKO_DMMA_PPA(LX) * NEKO_DMMA_PPA(LX))
150#define NEKO_DMMA_NBLCKS(NELV, LX) \
151 dim3(((NELV) + NEKO_DMMA_PACK(LX) - 1) / NEKO_DMMA_PACK(LX), 1, 1)
156 const char *
v =
getenv(
"NEKO_DMMA_NW");
169#define NEKO_TUNE_LOG_DMMA(LX, T3) \
171 for (int c = 0; c < NEKO_DMMA_CANDIDATES; c++) { \
172 if ((T3)[c] >= NEKO_TUNE_INIT) { continue; } \
174 sprintf(lbl_, "DMMA %dw %de", \
175 NEKO_DMMA_NW(c), NEKO_DMMA_PACK(LX)); \
176 sprintf(neko_log_buf, "%-13s: %9.2f us/call", lbl_, \
177 NEKO_TUNE_US((T3)[c], iters)); \
178 log_message(neko_log_buf); \
193#ifndef NEKO_DMMA_ARCH_COMPILED
194#if defined(__CUDA_ARCH_LIST__)
237 (
prop.major == 9)) ? 1 : 0;
272template< const
int LX >
294template< const
int LX >
300#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 800) && (__CUDA_ARCH__ < 1000)
328template< const
int LX, const
int PPA >
341 const int q = p /
LX3;
342 const int r = p - q *
LX3;
343 const int i = r %
LX;
344 const int jk = r /
LX;
345 const int j =
jk %
LX;
346 const int k =
jk /
LX;
347 const int qa = q %
PPA;
367template< const
int LX >
379 const int i = p %
LX;
380 const int jk = p /
LX;
381 const int j =
jk %
LX;
382 const int k =
jk /
LX;
400template< const
int AXIS >
405 typedef nvcuda::wmma::col_major layout;
414 typedef nvcuda::wmma::row_major layout;
423 typedef nvcuda::wmma::row_major layout;
436template< const
bool TRANSPOSE >
441 typedef nvcuda::wmma::col_major layout;
449 typedef nvcuda::wmma::row_major layout;
475 namespace wmma = nvcuda::wmma;
480 view::COL_MAJOR ? wmma::mem_col_major : wmma::mem_row_major;
494 for (
int p = 0; p <
npass; p++) {
495 const int t = wf + p *
NW;
498 wmma::fragment< wmma::accumulator, DMMA_P, DMMA_P, DMMA_KS, double >
acc;
503 wmma::fill_fragment(
acc, 0.0);
509 const int koff = view::COL_MAJOR ?
l0 : (
l0 * (
int) view::LDM);
511 typename view::layout > b;
513 wmma::load_matrix_sync(b,
in + view::base(t) +
koff, view::LDM);
__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__ v
__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 nelv
__global__ void const T *__restrict__ x
#define NEKO_DMMA_CANDIDATES
static bool dmma_arch_compiled()
static bool dmma_vector_lx_supported()
static bool cuda_have_dmma()
static int neko_dmma_env()
static bool dmma_lx_supported()